Skip to content

Instantly share code, notes, and snippets.

@mathias
Created July 31, 2013 00:02
Show Gist options
  • Save mathias/6118164 to your computer and use it in GitHub Desktop.
Save mathias/6118164 to your computer and use it in GitHub Desktop.
shoes minsky's circle algorithm animation glitches
Shoes.app do
epsilon = 1.0/16
offset = 250
initial_x = 100
initial_y = 100
fill red
@animate = animate (2) do |i|
epsilon = 10.0 / (i)
x = initial_x
y = initial_y
shape do
move_to(x + offset,y + offset)
100.times do
x = x - epsilon * y
y = y + epsilon * x
line_to(x + offset,y + offset)
end
end
@animate.stop if i > 160
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment