0

I have seen a lot of examples with finding the closest point on a line from a point but my case is different.

This image may help explain https://i.stack.imgur.com/tsUqy.jpg

I have a point (x3,y3) and a line/vector coming from that point at theta degrees.

There is another line in space between points (x1,y1) and (x2,y2).

I need to know if the vector crosses that line and if so what is the distance between (x3,y3) and the point at which the vector crosses the line between (x1,y1) and (x2,y2).

Can anyone help here with a snippet of code?

Thanks for any help.

Some1Else
  • 715
  • 11
  • 26
  • As with most questions I found a suitable bit of code minutes after posting. https://stackoverflow.com/a/14795484/4237309 works fine. – Some1Else Apr 04 '20 at 07:59
  • 1
    Does this answer your question? [How do you detect where two line segments intersect?](https://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect) – The Javatar Apr 04 '20 at 14:10

0 Answers0