MobilityDB 1.1

◆ closest_point2d_on_segment_ratio()

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

Return 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