def __init__(self, p1, sides,length): GeometricObject.__init__(self) self.start = p1 self.sideLength = length self.numsides = sides
def __init__(self, p1,r): GeometricObject.__init__(self) self.center = p1 self.radius = r
def __init__(self, p1,p2): GeometricObject.__init__(self) self.p1 = p1 self.p2 = p2
def __init__(self, x,y): GeometricObject.__init__(self) self.x = x self.y = y
def __init__(self, r=1.0, color="white", filled=True): '''creates a circle with radius r''' GeometricObject.__init__(self, color, filled) self._r = r
def __str__(self): return "Triangle: side 1 = " + str(self. _s1) + " side 2 = " + str(self._s2) +\ " side 3 = " + str(self._s3) + " " + GeometricObject.__str__(self)
def __init__(self, s1=1.0, s2=1.0, s3=1.0, color="white", filled=True): GeometricObject.__init__(self, color, filled) self._s1 = s1 self._s2 = s2 self._s3 = s3
def __str__(self): '''Circle with center (x, y) and radius radius''' return "Circle: radius = " + str( self._r) + " " + GeometricObject.__str__(self)