Skip to main content

line_intersection

Function line_intersection 

Source
pub fn line_intersection(
    p1: (f64, f64),
    d1: (f64, f64),
    p2: (f64, f64),
    d2: (f64, f64),
) -> Option<(f64, f64)>
Expand description

Computes the intersection of two lines defined by point + direction.

Each line is defined as p + t * d for scalar t. Returns None if the lines are parallel (cross product near zero).

ยงComplexity

O(1)