def test_distance_a_b(self):
     assert math.isclose(Point.distance(Point(1, 0), Point(0, 1)),
                         math.sqrt(2))
Exemplo n.º 2
0
 def _get_length(self):
     return Point.distance(self.start, self.end)
 def rotate_from_center(c, p, phi):
     radius = Point.distance(c, p)
     x = radius * math.cos(phi)
     y = radius * math.sin(phi)
     rotated = Point(x, y) + c
     return rotated