public void Distance(PointDouble p1, PointDouble p2, double d2, double distance) { p1.Distance2(p2).Should().Be(d2); p2.Distance2(p1).Should().Be(d2); p1.Distance(p2).Should().Be(distance); p2.Distance(p1).Should().Be(distance); }
public static double CompareLengthsMax(LineSegment segment0, LineSegment segment1) { double length0 = PointDouble.Distance(segment0.p0, segment0.p1); double length1 = PointDouble.Distance(segment1.p0, segment1.p1); if (length0 < length1) { return(1); } if (length0 > length1) { return(-1); } return(0); }