def test_equally_split_points(self): a = Point(0, 0) b = Point(3, 4) c = Point(6, 0) vector1 = Vector(a, b) vector2 = Vector(b, c) pc = PolygonalChain([vector1, vector2]) self.assertEqual(pc.get_split_points(3), [a, b, c])
def test_waged_split_points(self): a = Point(0, 0) b = Point(0, 10) c = Point(10, 10) vector1 = Vector(a, b) vector2 = Vector(b, c) pc = PolygonalChain([vector1, vector2]) self.assertEqual( pc.get_split_points(5, [0, 0.4, 0.5, 0.6, 1]), [a, Point(0, 8), b, Point(2, 10), c])
def test_equally_split_points2(self): a = Point(0, 0) b = Point(0, 10) c = Point(10, 10) vector1 = Vector(a, b) vector2 = Vector(b, c) pc = PolygonalChain([vector1, vector2]) self.assertEqual( pc.get_split_points(5), [a, Point(0, 5), b, Point(5, 10), c])
def test_init_dy(self): a = Point(0, 0) b = Point(3, 4) c = Point(6, 0) vector1 = Vector(a, b) vector2 = Vector(b, c) pc = PolygonalChain([vector1, vector2]) self.assertEqual(pc.dy, 0)
def test_init_end_point(self): a = Point(0, 0) b = Point(10, 10) c = Point(20, 0) vector1 = Vector(a, b) vector2 = Vector(b, c) pc = PolygonalChain([vector1, vector2]) self.assertEqual(pc.end, c)