@@ -0,0 +1,1272 @@
+#!/usr/bin/env python3%0A%0Aclass Triangle:%0A    %22%22%22A class structure for storing and minipulating a triangle.%0A%0A    The trianlge is represented as a 3-tuple of points. Each point is%0A    represented as a 2-tuple of floats, the first element being the%0A    x-coordinate and the second element being the y-coordinate.%0A%0A    Several useful operations can be applied to a triangle such as, rotate,%0A    translate, split across altitude, and rectanglify.%0A    %0A    The Triangle (and underlying tuple) should be treated as an immutable%0A    data structure. All methods return a new triangle and do not modify the%0A    existing one.%22%22%22%0A%0A    def __init__(self, tpl):%0A        %22%22%22tpl is a 3-tuple of coordinates%22%22%22%0A        self.points = tpl%0A        %0A%0Aclass Shape:%0A    %22%22%22A class structure for representing and minipulating arbitary shapes.%0A    %0A    A shape is defines as a list of triangles (see Triangle). Several%0A    operations can be applied to a shape such as rotation, translation and%0A    splitting the shape into two.%0A%0A    This object should be treated as an immutable data structure. All methods%0A    return new shapes and do not modify the existing one.%22%22%22%0A%0A    def __init__(self, triangle_list):%0A        %22%22%22triangle_list is a list of triangles%22%22%22%0A        self.triangles = triangle_list%0A

Add Triangle and Shape data structures