Exemplo n.º 1
0
 public void PointsDistanceTaxicab()
 {
     Point p1 = new Point(10.0, 15.0);
     Point p2 = new Point(7.0, 19.0);
     IDistanceMetric metric = new TaxicabDistance();
     PointsDistance distance = new PointsDistance(metric);
     Assert.AreEqual(7.0, distance.CalculateDistance(p1, p2));
 }
Exemplo n.º 2
0
        public void TaxicabCalculateDistance_differencesNegativeDistancePositive()
        {
            double[]        a      = { 10.0, 34.0 };
            double[]        b      = { 13.0, 38.0 };
            TaxicabDistance metric = new TaxicabDistance();
            double          result = metric.CalculateDistance(a, b);

            Assert.AreEqual(7.0, result);
        }