mathnet-spatial
mathnet-spatial copied to clipboard
Fix Line2D.TryIntersect to pass nullable Point2D
This pull-request is asking for help to solve #178.
The problem is that LineSegment2D.TryIntersect() always passes by reference Point2D of intersection, regardless of whether the two LineSegment2D actually have a valid intersection or not.
In my fix, LineSegment2D.TryIntersect() passes by ref Point2D?, which can indicate that there is no intersection.
My fix used #111 as reference.
I'm not sure that this breaking change is acceptable or not. If there is another way to solve this, I'm happy to learn it.
I considered these fix-plans:
- Leave it as it is
- Pass by ref default(Point2D)
- Pass by ref Nullable<Point2D>
- Pass by ref Point2D.Null (kinda)
- Return Nullable<Point2D> instead of bool