0

Simple: If I have two lines which meet at one end how can I detect that they touch?

All the line intersection algorithms that I've seen do not detect this scenario.

My specific problem is testing one line against a list of lines. The intersection which fails is when the intersecting line crosses the end point of one of the lines. For example, when the list of lines are a series of lines connected by their endpoints, the intersecting line does not generate a intersect detection for the connection point.

By 'touch' I mean where the very end of one line intersects the length of another.

I'm not sure of the names of the algorithms I've used, but they are mostly from stackoverflow: Efficient maths algorithm to calculate intersections Algorithm for intersection of 2 lines? How do you detect where two line segments intersect?

Community
  • 1
  • 1
Matt W
  • 11,753
  • 25
  • 118
  • 215
  • 4
    Check whether they share the same end point? – herohuyongtao Mar 16 '14 at 10:08
  • 3
    Define "touch". also, please state which algorithms you have tried that didn't work for you – NiRR Mar 16 '14 at 10:10
  • They don't share endpoints - the complex part of it is that I'm trying to find out when the intersecting line falls on the join between two lines which share the same endpoint. 'Touch' means that the endpoint of a line meets the length of a line. – Matt W Mar 16 '14 at 12:44

0 Answers0