Intersection of two line segments

0
Remix

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.

Applied IntuitionCodingLast asked Feb 2026
No answer yet. Write the first one; the best answer gets endorsed.