line crossing another line

BlitzMax Forums/BlitzMax Programming/line crossing another line

Craig H. Nisbet(Posted 2008) [#1]
I think I've seen this answered on here before, I'm not sure. I'm looking for code that will tell me if a line is crossing another line. I guess there would be four coordinates, the x and y of the first line and the x and y of the second line. Anyone know how to test if they are crossing?


Torrente(Posted 2008) [#2]
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=geometry2#line_line_intersection

That looks like it should work, although I haven't tried it out yet.


tonyg(Posted 2008) [#3]
Concave/convex polygon collisions and other useful functions which includes Linescrossed function.


EOF(Posted 2008) [#4]
There are Blitz classic versions here if you fancy converting to Max:

http://www.blitzmax.com/codearcs/codearcs.php?code=1855

http://www.blitzmax.com/codearcs/codearcs.php?code=2180