Example #1
0
        public void StaticEuclideanSingleDimensionDistanceWorksWithNonExactDistances(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((decimal)XYPoint.DirectDistanceBetween(p, q), Is.EqualTo((decimal)distance));
            Assert.That((decimal)XYPoint.DirectDistanceBetween(q, p), Is.EqualTo((decimal)distance));
        }
Example #2
0
        public void StaticEuclideanSingleDimensionDistanceWorks(int x1, int y1, int x2, int y2, int distance)
        {
            var p = new XYPoint(x1, y1);
            var q = new XYPoint(x2, y2);

            Assert.That((decimal)XYPoint.DirectDistanceBetween(p, q), Is.EqualTo((decimal)distance));
            Assert.That((decimal)XYPoint.DirectDistanceBetween(q, p), Is.EqualTo((decimal)distance));
        }