Computer Science Canada Intersection of line segments |
Author: | RandomLetters [ Sat Feb 11, 2012 11:35 pm ] |
Post subject: | Intersection of line segments |
How can I find if two line segments intersect each other on a computer? |
Author: | mirhagk [ Sun Feb 12, 2012 2:25 pm ] |
Post subject: | RE:Intersection of line segments |
Have you done this in grade 9 math? |
Author: | RandomLetters [ Sun Feb 12, 2012 5:36 pm ] |
Post subject: | RE:Intersection of line segments |
Ah, nevermind. My problem was that I couldn't use y = mx+b because one of the lines is vertical, but then I realized that this meant that the x coordinate would be known already. |
Author: | mirhagk [ Sun Feb 12, 2012 7:44 pm ] |
Post subject: | RE:Intersection of line segments |
actually you could determine it using parametric lines, which is approximately 25% faster, but more complicated (however it works for all cases, including vertical lines) |