MCPcopy Create free account
hub / github.com/csev/py4e / Circle

Class Circle

code/graphics/graphics.py:624–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622
623
624class Circle(Oval):
625
626 def __init__(self, center, radius):
627 p1 = Point(center.x-radius, center.y-radius)
628 p2 = Point(center.x+radius, center.y+radius)
629 Oval.__init__(self, p1, p2)
630 self.radius = radius
631
632 def clone(self):
633 other = Circle(self.getCenter(), self.radius)
634 other.config = self.config.copy()
635 return other
636
637 def getRadius(self):
638 return self.radius
639
640 def __str__(self):
641 return "Circle: center %s, r = %s" % \
642 (self.getCenter().coordStr(), approx(self.radius))
643
644
645class Line(_BBox):

Callers 1

cloneMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected