示例#1
0
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)
示例#2
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)
示例#3
0
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)
示例#4
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)
示例#5
0
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)
示例#6
0
def petal(t, r, angle):
    for i in range(2):
        arc(t, r, angle)
        t.lt(180 - angle)
示例#7
0
def petal(turtle, length, angle):
    arc(turtle, length, angle)
    turtle.lt(180 - angle)
    arc(turtle, length, angle)
示例#8
0
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)