intersection_of_segments

Function intersection_of_segments 

Source
pub fn intersection_of_segments<P: GetXY, Q: NewXY>(
    a: (&P, &P),
    b: (&P, &P),
) -> Option<IntersectionOfSegments<Q>>
Expand description

Find the intersection of two segments

NOTE: Segments that are only touching eachothers endpoints are considered intersections

§Parameters

  • a: the first segment
  • b: the second segment

§Returns

A point if the segments intersect where the intersection occurs, otherwise undefined