|
A utility class to find / test for intersections between geometric shapes.
In this static class, function names always have the two basic shapes ordered using the following order: [Unrecognized tag: "list"][Unrecognized tag: "item"]Line (straight line; infinite)[Unrecognized tag: "item"]Ray (starts at a point, extends to infinity)[Unrecognized tag: "item"]Segment (starts and ends on finite points)[Unrecognized tag: "item"]Circle[Unrecognized tag: "item"]Arc[Unrecognized tag: "item"]Rectangle (axis-aligned, ordered coords of each edge are known)[Unrecognized tag: "item"]BoundingBox (axis-aligned, ordered coords of each edge are known)
Hence it's always LineWithCircle, never CircleWithLine.
Many functions return one or multiple “lambda” values. These indicate how far along a line a point of intersection
is from its start point, relative to its end point: - A negative value indicates a position “before” the start point; 0 is the start point; 0.5 is the midpoint; 1
is the endpoint; and a value greater than 1 indicates a position “beyond” the end point.
- If no point of intersection exists, a lambda value of
double.NaN is returned. - If only one point of intersection is found by a function that returns two lambdas, it is always the first
lambda that identifies the point of intersection while the second is set to
double.NaN .
In cases where multiple points of intersections are possible, such as between a line and a circle, those overloads
that return only one point always return the one that is closer to the line’s start point. |