Skip to main content

plane_plane_intersection

Function plane_plane_intersection 

Source
pub fn plane_plane_intersection(
    n1: Vec3,
    d1: f64,
    n2: Vec3,
    d2: f64,
    tolerance: f64,
) -> Option<(Point3, Vec3)>
Expand description

Compute the intersection line of two planes.

Each plane is defined by a normal n and signed distance d such that n ยท p = d for all points p on the plane.

Returns Some((point, direction)) where point lies on the intersection line and direction is a unit vector along it. Returns None if the planes are parallel (or coincident) within tolerance.