distanceToSegment

Distance between a point and a line segment.

Return

The Euclidean distance from p to the closest point on segment v-w.

Parameters

p

The query point.

v

The start of the line segment.

w

The end of the line segment.