Exemple #1
0
def draw_s(t, n):
    fd(t, n / 2)
    arc(t, n / 2, 180)
    arc(t, n / 2, -180)
    fdlt(t, n / 2, -90)
    skip(t, 2 * n)
    lt(t)
Exemple #2
0
def draw_j(t, n):
    beam(t, n, 2)
    arc(t, n / 2, 90)
    fd(t, 3 * n / 2)
    skip(t, -2 * n)
    rt(t)
    skip(t, n / 2)
Exemple #3
0
def bump(t, n, height):
    """Makes a bump with radius n at height*n 
    """
    stump(t, n * height)
    arc(t, n / 2.0, 180)
    lt(t)
    fdlt(t, n * height + n)
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)
Exemple #5
0
def print_spiral1(t):
    l = 1
    while l < 400:
        arc(t, l, 60)
        if l < 10:
            l += 2
        elif l < 20:
            l += 5
        else:
            l += 10
Exemple #6
0
def print_spiral2(t, cte):
    l = 1
    while l < 400:
        arc(t, l, 60)
        l *= cte