mathnet / mathnet-spatial

Math.NET Spatial
http://spatial.mathdotnet.com
MIT License
376 stars 132 forks source link

LineSegment3D.TryShortestLineTo throws when segments intersect #175

Closed peterhirn closed 1 year ago

peterhirn commented 4 years ago
[Test]
public static void LineSegment3DIntersection()
{
    var tolerance = Angle.FromRadians(0.00001);

    var l1 = new LineSegment3D(new Point3D(0, 0, 0), new Point3D(10, 0, 0));
    var l2 = new LineSegment3D(new Point3D(5, -5, 0), new Point3D(5, 5, 0));

    Assert.IsFalse(l1.TryShortestLineTo(l2, tolerance, out _));
}

Throws: System.ArgumentException : The segment starting and ending points cannot be identical

JohanLarsson commented 4 years ago

Thanks for reporting, this is a pretty dumb bug, sorry about it.