示例#1
0
 def test_distance_with_overlap(self):
     a = BoundingBox(0, 0, 0, 10, 10, 10)
     b = BoundingBox(2, 5, 8.8, 33, 15, 30)
     self.assertEqual(0, a.dist(b))
示例#2
0
 def test_distance_only_x_different(self):
     a = BoundingBox(0, 0, 0, 10, 10, 10)
     b = BoundingBox(23, 0, 0, 33, 10, 10)
     self.assertEqual(13, a.dist(b))
     self.assertEqual(a.dist(b), b.dist(a))
示例#3
0
 def test_distance_no_overlap(self):
     a = BoundingBox(0, 0, 0, 10, 10, 10)
     b = BoundingBox(23, 5, -50, 33, 15, -30)
     self.assertEqual(math.sqrt(1069), a.dist(b))
     self.assertEqual(a.dist(b), b.dist(a))