diff --git a/orbit_test.py b/orbit_test.py new file mode 100644 index 0000000..e0dbc7d --- /dev/null +++ b/orbit_test.py @@ -0,0 +1,27 @@ +from turtle import * +from superturtle.animation import animate +from superturtle.movement import restore_state_when_finished + +DOTSIZE = 10 + +def electron(radius): + """Assumes the turtle already has the proper heading. + """ + with restore_state_when_finished(): + penup() + forward(radius) + pendown() + dot(DOTSIZE) + +for frame in animate(360, loop=True): + with frame.rotate(0, 359, cycles=2): + electron(100) + right(180) + electron(100) + with frame.rotate(0, 359): + electron(140) + right(180) + electron(140) + +input() +