FMath::PointDistToSegmentSquared

Returns square of the distance from a point to the closest point on a segment.