MobilityDB  1.0

◆ closest_point2d_on_segment_ratio()

long double closest_point2d_on_segment_ratio ( const POINT2D *  p,
const POINT2D *  A,
const POINT2D *  B,
POINT2D *  closest 
)

Returns a long double between 0 and 1 representing the location of the closest point on the segment to the given point, as a fraction of total segment length (2D version).

Note
Function derived from the PostGIS function closest_point_on_segment.