How do you detect where two line segments intersect? How do I determine whether or not two lines intersect, and if they do, at what x,y point?