intersection between 4points(2lines)

Hi,

I want to calculate an intersection between 2 lines. those two lines are drawn between 4 points.

I now how to make the y=ax+b expression but the problem is that there is always an intersection between to lines if they don't have the same slope(a).

So i need to find a formula which returns a bool when the intersection is between the 4 points and not over whole the line.

Grtz

Annihil8

[424 byte] By [Annihil8] at [2007-12-24]
# 1
I don't believe that C# has anything common with your problem. Your problem is strictly trigonometric and you should consult some Math book for this.
What you need to search is cross point between two lines that are passing those two points each and find if that cross point is between their two points of both lines.
boban.s at 2007-10-8 > top of Msdn Tech,Visual C#,Visual C# General...