I want to provide a map route question function to know the starting and ending points of a route. so, how do I know the starting point and ending point of a location? ------ Solution -------------------- start point (x0, y0) and end point (x1, y1), then the slope is & nbsp; k & nbsp; (y1-y0) (x1-x0) if point (x, y) is on this line, there is a (y-y0) (x-x0) & nbs map route problem
I want to make a function to know the starting and ending points of a route. so, how can I know the starting point and ending point of a route?
------ Solution --------------------
Start point (x0, y0) and end point (x1, y1), then the slope is k = (y1-y0)/(x1-x0)
If point (x, y) is on this line, there is (y-y0)/(x-x0) = k
The map route consists of multiple broken lines. you can apply the discriminant algorithm one by one and relax the error accordingly.
Because in actual road construction, if the line is near A, it may bypass A, or it may build A branch line between the line and.