There are two arrays of points that form two broken lines. Is there an algorithm for finding the intersection points of these two lines?
The search for the intersection of each of the segments of both lines comes to mind.
There are two arrays of points that form two broken lines. Is there an algorithm for finding the intersection points of these two lines?
The search for the intersection of each of the segments of both lines comes to mind.
The classic textbook algorithm for finding all intersections in a set of segments is the sweep line algorithm. The fact that in your case we are dealing not with an arbitrary set of segments, but with two broken lines, as it seems to me, does not greatly change the situation.
Another thing, if you know in advance any additional information about your broken lines.
For example, if you know in advance that your broken lines are monotonous along a general direction, then in such a situation you can search for all intersections by a simple linear passage along the broken line.
Source: https://ru.stackoverflow.com/questions/279227/
All Articles