views:

85

answers:

2

As shown in this image:

alt text

I have a set of line segments. I want to check which line-segments intersect with the perpendicular line drawn from a given point (x0,y0).

(E.g.: AB passes the check and BC does not.)

The only information I've got is two points of the line-segment, (x1,y1), (x2,y2), and the target point (x0,y0).

Is it possible to derive a simple formula using these three points?

Thanks in advance.

umanga

+1  A: 

For a line AB and a point X, both angles, ABX and BAX must be acute (or right).

Svante
+2  A: 
brainjam
thanks alot! this worked!
umanga