segmentDistance

expect fun segmentDistance(p1: Vec2, q1: Vec2, p2: Vec2, q2: Vec2): SegmentDistanceResult

Compute the distance between two line segments, clamping at the end points if needed.

Return

The segment distance result

Parameters

p1

Start of segment 1

q1

End of segment 1

p2

Start of segment 2

q2

End of segment 2