distanceToSegmentSquared

Squared distance between a point and a line segment (faster, avoids sqrt).

Return

The squared 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.