示例#1
0
 def test_distance_all_2(self):
     p1 = point.Point(0.0, 0.0)
     p2 = point.Point(-3.0, 4.0)
     p3 = point.Point(5.0, -12.0)
     l1 = map.distance_all([p1, p2, p3])
     l2 = [0.0, 5.0, 13.0]
     self.assertListAlmostEqual(l1, l2)
示例#2
0
 def test_distance_all2(self):
     pt_list = [point.Point(1, 0), point.Point(2, 0), point.Point(3, 3)]
     new_list = [1, 2, math.sqrt(18)]
     self.assertEqual(map.distance_all(pt_list), new_list)
示例#3
0
 def test_distance_all1(self):
     pt_list = [point.Point(1, 1), point.Point(2, 2)]
     new_list = [math.sqrt(2), math.sqrt(8)]
     self.assertEqual(map.distance_all(pt_list), new_list)
示例#4
0
 def test_6(self):
     t = [[-6, -7], [8, 9], [0, 2]]
     self.assertAlmostEqual(map.distance_all(t), [9.2, 12.0, 2])
示例#5
0
 def test_5(self):
     t = [[3, 4], [6, 7], [8, 9]]
     self.assertAlmostEqual(map.distance_all(t), [5, 9.2, 12.0])
示例#6
0
    def test_6(self):
        x = [[2, 2], [4, 3]]
        self.assertAlmostEqual(map.distance_all(x), [math.sqrt(8), 5])

        # Add code here.
        pass
示例#7
0
 def test_5(self):
     x = [[0, 0], [1, 1]]
     self.assertAlmostEqual(map.distance_all(x), [0, math.sqrt(2)])
示例#8
0
 def test_distance_all_2(self):
    list = [point.Point(6, 8), point.Point(3, 4), point.Point(0, 8)]
    origin = point.Point(0, 0)
    expected = [10, 5, 8]
    self.assertEqual(map.distance_all(list, origin), expected)
示例#9
0
 def test_distance_all(self):
    list = [point.Point(6, 0), point.Point(3,0), point.Point(4, 0)]
    origin = point.Point(0, 0)
    expected = [6, 3, 4]
    self.assertEqual(map.distance_all(list, origin), expected)
示例#10
0
 def test_distance_all2(list):
 	list = [(1,2),(3,4),(5,6),(20,30)]
 	map.distance_all(list)
 	list.__eq__([2.24,5,7.81,36.056])
示例#11
0
 def test_distance_all1(self):
     list=[(0,0),(0,1),(1,0)] 
     map.distance_all(list)
     list.__eq__([0,1,1])