Code Monkey home page Code Monkey logo

geometry-challenge-problem's Introduction

Challenge Problem

Given a set of 2-dimensional lines, we would like to find the pair of lines with the smallest intersection angle in the set, and the point in the 2-dimensional plane at which they intersect.

Inputs

Your program should expect a text file as input with each line in the text file specifying an infinite line, represented by two x-y coordinate pairs that fall on that line in the form "x1,y1;x2,y2". The text file may have any number of lines.

Example

1,1;10,10
1,10;10,1

Output

Your program should output to the console the two intersecting lines that have the smallest angle between them (as compared to all other line intersections in the set) in the same format as the input file, the minimum angle at intersection (in degrees), and the point at which they intersect.

Example

Line 1: 1,1;10,10
Line 2: 1,10;10,1
Intersection Angle: 45.0
Intersection Point: 5.5,5.5

Considerations

Rubric

  • Readability: variables, functions, and classes are named clearly indicating their purpose
  • Correctness: the code solves the problem as described by the requirements
  • Testing: appropriate tests are included to ensure that the code works correctly
  • Repeatability: the code includes instructions and dependency expectations for us to run it locally on our side.

Timing

We believe this problem should take between one and four hours to complete. If you find yourself at the four hour mark and have not finished, stop and send in what you have.

Submission

Send a .zip file or a link to your git repository to [email protected] by at least the night before your review session. We will review the code and test a number of edge cases before the session. Good luck!

geometry-challenge-problem's People

Contributors

rsmithpivotbio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.