Skip to main content

segment_distance

Function segment_distance 

Source
pub fn segment_distance(
    p1: Vec2,
    q1: Vec2,
    p2: Vec2,
    q2: Vec2,
) -> SegmentDistanceResult
Expand description

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

Follows Ericson 5.1.9 Closest Points of Two Line Segments.