Skip to main content

line_intersection

Function line_intersection 

Source
pub fn line_intersection<S, P>(
    first: &S,
    second: &S,
) -> Result<Option<LineIntersection<P>>, OverlayError>
where S: SegmentTrait<Point = P>, P: PointMut + Default, P::Scalar: CoordinateScalar + Into<f64> + PartialEq,
Expand description

Intersect two segments and report proper, touch, and collinear cases.

This is the public counterpart of the Cartesian intersection strategy in strategy/cartesian/intersection.hpp. It preserves this port’s explicit range refusal instead of returning a potentially unreliable coordinate.

§Errors

Returns OverlayError::Unsupported when an endpoint lies outside the exact-predicate range.