private static bool PointsAlmostEqual(Point2 a, Point2 b) { if (a == b) { return(true); } var d = a.Difference(b); return(d.GetMagnitudeSquared() < 0.000000000000000001); }
public void difference() { var a = new Point2(1, 3); var b = new Point2(2, 4); var diff = a.Difference(b); Assert.Equal(a.X - b.X, diff.X); Assert.Equal(a.Y - b.Y, diff.Y); }
private static bool PointsAlmostEqual(Point2 a, Point2 b) { if (a == b) return true; var d = a.Difference(b); return d.GetMagnitudeSquared() < 0.000000000000000001; }