← Questions
Intersection of two line segments
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Given two line segments in the plane, each by its two endpoints, decide whether they intersect and return the intersection point (or the overlapping piece when they are collinear and overlap). Handle parallel segments, segments that only touch at an endpoint, vertical segments and collinear overlaps, and say how you deal with floating-point error.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
