def test_distance(self): self.assertEqual(TwoDPoint.distance(self.point1, self.point3), 5) self.assertEqual(TwoDPoint.distance(self.point1, self.point4), 0)
def side_lengths(self): """Returns a tuple of four floats, each denoting the length of a side of this quadrilateral. The value must be ordered clockwise, starting from the top left corner.""" v = self.vertices return TwoDPoint.distance(v[1], v[0]), TwoDPoint.distance(v[0], v[3]),\ TwoDPoint.distance(v[3], v[2]), TwoDPoint.distance(v[2], v[1])