Detecting Line Intersection

Drag the balls to change the position of the lines. The line segments turn green to indicate they intersect.