The X position of point (px, py).
The Y position of point (px, py)
The X position of the line segment's vertex A.
The Y position of the line segment's vertex A.
The X position of the line segment's vertex B.
The Y position of the line segment's vertex B.
The distance squared from the point (px, py) to line segment AB.
Returns the distance squared from the point to the line segment.
Behavior is undefined if the the closest distance is outside the line segment.