Skip to main content

calc_intersection

Function calc_intersection 

Source
pub fn calc_intersection(
    ax: f64,
    ay: f64,
    bx: f64,
    by: f64,
    cx: f64,
    cy: f64,
    dx: f64,
    dy: f64,
) -> Option<(f64, f64)>
Expand description

Calculate the intersection point of two line segments: (ax,ay)→(bx,by) and (cx,cy)→(dx,dy). Returns Some((x, y)) if they intersect, None if parallel.