Skip to main content

segments_intersect

Function segments_intersect 

Source
pub fn segments_intersect(
    p1: [f64; 2],
    q1: [f64; 2],
    p2: [f64; 2],
    q2: [f64; 2],
) -> bool
Expand description

Whether two segments (p1-q1) and (p2-q2) intersect.

Uses the standard orientation-based algorithm. Handles collinear overlapping segments correctly.