Skip to main content

intersect_segment_segment

Function intersect_segment_segment 

Source
pub fn intersect_segment_segment(
    p1: &Coordinate,
    p2: &Coordinate,
    p3: &Coordinate,
    p4: &Coordinate,
) -> SegmentIntersection
Expand description

Computes intersection of two line segments

Uses parametric form to find intersection point(s). Handles:

  • Non-intersecting segments
  • Single point intersection
  • Overlapping collinear segments

§Arguments

  • p1 - First endpoint of segment 1
  • p2 - Second endpoint of segment 1
  • p3 - First endpoint of segment 2
  • p4 - Second endpoint of segment 2

§Returns

The intersection type (None, Point, or Overlap)