1

I have seen multiple questions about finding one point where two lines intersect but I can't find an answer to what do if I also want to find lines that overlap in more than one point.

Lets say I have line 1 going from (X:1, Y:2) to (X:10, Y:2) line 2 goes from (X:5, Y:2) to (X:15 Y:2) then the lines would overlap from 5 to 10. I would also like to be able to tell lines that are crossing each other in other angles and only have 1 intersection point, for example a line going from (X:5, Y:1) to (X:7, Y:3) what would the easiest way be to detect these and get the points of overlap?

falowil
  • 125
  • 1
  • 9
  • 1
    Someone should probably dupehammer the multiple questions, but I think [this answer](https://stackoverflow.com/a/38112653/2144669) works out the multiple edge cases you need. – David Eisenstat Sep 20 '20 at 20:32
  • 1
    Do you know how to check whether two lines have the same slope? How to calculate the distance between parallel lines? How to find the intersection point of two non-parallel lines? What part of the problem is giving you trouble? – Beta Sep 21 '20 at 01:38

0 Answers0