Closed DaveInCaz closed 1 year ago
Hi,
I don't think this is a big issue. Conceptually it seems logical to progress in increasing detail, so the first thing to check would be that all points are distinct. Then, once we make sure that this is satisfied, we must control that the points should not be collinear.
Let me know that you think.
Nothing to fix
Ref: https://github.com/mathnet/mathnet-spatial/blob/master/src/Spatial/Euclidean/Plane.cs
Here's the main body of
FromPoints
:It seems to me that the initial check for having two or more equal points is redundant to the later check that the cross product result is > 0. (Two or three equal points would obviously also all fall on the same line.)
Is it worth having the first check? It incurs some extra overhead.
Although in cases where two points really are equal the function would do more work without the first check, since an exception is going to fire anyway I'm not sure that is a real concern.