I dont know where is the original poster?!!!!
But I want to go on this thread...
well,
in way 2,I told you we should have a function that determines if two lines intersect each other or not but How we can implement it?!!!
its quite easy.
if you know some algebra and arithmetic you can easily solve this problem
suppose we have two lines
L1(x1,y1,x2.y2)
L2(a1,b1,a2,b2)
so in plane page(X,Y coordinate)
L1:(y-y1)/(x-x1)=(y1-y2)/(x1-x2)
L2:(y-b1)/(x-a1)=(b1-b2)/(a1-a2)
now we should find the intersection point ,if there is not that means this two lines dont intersect each other at all but if there is one we should check if this point is included in both linesif so that means this two lines intersect each other
for getting the intersection point we can use Kramer method(sorry for the dictation if its wrong)
for checking if a point is included in a line we should write another method I will explain it in my next post.
any opinion!!!!!
(I'm just like you a student hope you contribute in this discussion!)
--------------------------------------------
Mehdi.:)
|