pub fn line_intersection_2d<T>(
n: LineSegment2<T>,
m: LineSegment2<T>,
) -> LineIntersection<T>Expand description
Calculate the intersection of two 2D lines. The lines are defined by two line segments, and the intersection may lie outside either segment. I.e., for intersection purposes the lines are considered infinite. This function does not guarantee that the intersection point lies within the bounds of the line segments or that the intersection point lies within some coordinate space (like world size).
§Arguments
n- The first line segment.m- The second line segment.
§Returns
The intersection type.
- LineIntersection::Point if there is an intersection.
- LineIntersection::Coincident if the lines are coincident and there is no intersection. This means the lines lie on top of each other. They are parallel but have no separation. It could be said that they intersect at infinitely many points.
- LineIntersection::Parallel if the lines are parallel and there is no intersection.