I need to know whether or not two line segments intersect. I thought the formula for that is y = mx + b but I don't think that will work for what I need, at least I think I need to first know whether the line segments intersect, because that formula just gives the point where the two lines will eventually intersect.
For example, say I have two line segments. Line 1 has a starting point of 15, 10 and its ending point is 30, 17. Line 2 has a starting point of 29,5 and an ending point of 33, 14. These shouldn't intersect within those coordinates, but by using y = mx + b I find that they intersect as 35, 19.5 (approx.)
How can I find out whether these line segments should intersect each other?
