def test_distance(self): # given the two points point1 = Point(5, 0) point2 = Point(5, 5) # when we use one to calculate the distance to the other distance = point1.distance(point2) # then we get the distance between the two points self.assertEqual(distance, 5)
def distance_from_camera_cover(self, cover): middle = Point.middle(cover.points) #print(middle) return Point.distance(middle, self.start_point)
def distance_from_camera(self, edge): edge_middle = Point.middle((edge.point1, edge.point2)) #print(edge_middle) return Point.distance(edge_middle, self.start_point)