예제 #1
0
 def test_dist_with_different_dimensions(self):
     """If two points are in different dimensions, the higher dimensional
     point should be projected to the lower dimensional space.
     """
     p, q = Point([3, 4]), Point([0])
     self.assertEqual(p.dist(q), 3)
     r = Point([0, 0, 100])
     self.assertEqual(p.dist(r), 5)
예제 #2
0
 def test_dist_2D(self):
     a = Point([1, 3])
     b = Point([13, 8])
     self.assertEqual(a.dist(b), 13)