|
The line connecting each 2 consecutive points on the track is called a segment
This function finds the segment which is the closest to the given point P
This is totally different from finding the closest point.
A certain segment of the track could be the closest segment to a given point P
despite the fact that its two edges point are the most further away points
from the give point P. (think of it ...)
Parameters:
[in] track_handle:
a handle to a track
[in] P:
A point in space.
Return Value.
The function returns the index of the beginning of the closest segment
if index 0 is returned then the closest segment is point-0 to point-1
if index_of_closest==trk->number_of_points-1
then the closest segment is from the last point to the first point.
Example:
double P[3]={1,2,3};
int index=STATE_track_find_closest_segment_on_track(my_track, P);
|