def draw_circle(t, c): t.pu() t.goto(c.center.x, c.center.y - c.radius) t.pd() arc(t, c.radius, 360) t.pu() t.goto(0, 0) t.seth(0)
def petal(t, r, angle): """Draws a petal using two arcs. t: Turtle r: radius of the arcs angle: angle (degrees) that subtends the arcs """ for i in range(2): arc(t, r, angle) t.lt(180 - angle)
def one_petal(t, r, angle): ''' Input t: turtle r: radius angle:entre segmentos ''' for i in range(2): arc(t, r, angle) t.lt(180 - angle)
def draw_circle(circle, turtle): """ takes an instance of Circle and an instance of Turtle draws given Circle using given Turtle """ # start drawing from bottom edge position_turtle(turtle=turtle, x=circle.center.x, y=circle.center.y - circle.radius) arc(t=turtle, r=circle.radius, angle=360)
def petal(t, r, angle): for i in range(2): arc(t, r, angle) t.lt(180 - angle)
def petal(turtle, length, angle): arc(turtle, length, angle) turtle.lt(180 - angle) arc(turtle, length, angle)
def flower(t, n=7, length=100): for i in range(n): arc(t, length, 360 / n) t.lt(180 - 360 / n) arc(t, length, 360 / n) t.lt(180)