def action(): to_center(small_ball) global pos def processor(rad): return 4 * sin(2 * rad) * big_rad / 4 x, y = from_polar(pos, processor) move_to(small_ball, x, y, True) pos += _step
def task_4(): """Flower""" to_center(small_ball) def action(): global pos def processor(rad): return sin(6 * rad) * big_rad x, y = from_polar(pos, processor) move_to(small_ball, x, y, True) pos += _step loop(action)
def task_9(): """Flower three""" to_center(small_ball) def action(): global pos def processor(rad): return rad * 5 + sin(rad * wave_freq) * wave_amp / 5 * (-rad / 5) x, y = from_polar(pos, processor) move_to(small_ball, x, y, True) pos += _step loop(action)
def task_7(): """Sinusoidal spiral""" to_center(small_ball) def action(): global pos def processor(rad): return rad * 5 + sin(rad * wave_freq) * wave_amp / 5 x, y = from_polar(pos, processor) move_to(small_ball, x, y, True) pos += _step loop(action)
def task_6(): """Spiral""" to_center(small_ball) def action(): global pos def processor(rad): return rad * 5 x, y = from_polar(pos, processor) move_to(small_ball, x, y, True) pos += _step loop(action)
def task_5(): """Apple""" to_center(small_ball) pos = 90 def action(): nonlocal pos def processor(rad): return (1 - sin(rad)) * (big_rad / 2) x, y = from_polar(pos, processor) move_to(small_ball, x, y, True) pos += _step loop(action)