Answer the question
In order to leave comments, you need to log in
How to find out if a point belongs to a specified segment?
I have a certain base of segments (steps) of the route:
I have the coordinates of a point that exactly belongs to one of the specified routes. How do I know which route leg a point belongs to?
Answer the question
In order to leave comments, you need to log in
So get the equation of a straight line through 2 points.
Make sure that x0<= x <= x1 and y0 <= y <= y1 (x0 < x1, same as y0 < y1)
Insert a point into a line.
Check for equality.
Season with errors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question