Beispiel #1
0
        public void EuclideanSingleDimensionDistanceWorksWithNonExactDistances(double x1, double y1, double x2, double y2, double distance)
        {
            var p = new XYPoint((int)x1, (int)y1);
            var q = new XYPoint((int)x2, (int)y2);

            Assert.That(p.DirectDistanceFrom(q), Is.EqualTo(distance));
            Assert.That(q.DirectDistanceFrom(p), Is.EqualTo(distance));
        }
Beispiel #2
0
        public void EuclideanSingleDimensionDistanceWorks(int x1, int y1, int x2, int y2, int distance)
        {
            var p = new XYPoint(x1, y1);
            var q = new XYPoint(x2, y2);

            Assert.That(p.DirectDistanceFrom(q), Is.EqualTo(distance));
            Assert.That(q.DirectDistanceFrom(p), Is.EqualTo(distance));
        }