Skip to content

Instantly share code, notes, and snippets.

@almost
Created July 3, 2020 08:48
Show Gist options
  • Save almost/dbef13e153c284674a210b731efeec66 to your computer and use it in GitHub Desktop.
Save almost/dbef13e153c284674a210b731efeec66 to your computer and use it in GitHub Desktop.
round = 500.0;
def setup():
size(1000, 1000)
def xy(i):
global round
dist = float(i * 2);
angle = (i/((float(round)+500)))*360
x = cos(angle)*dist;
y = sin(angle)*dist;
return (width/2+x,height/2+y)
def draw():
global round
background(200)
round = (round + 1) % 500
for i in range(500):
(x,y) = xy(i)
#ellipse(width/2+x, height/2+ y, 80, 80);
if i % 1 == 0:
(x1,y1) = xy(i-10)
(x2,y2) = xy(i)
(x3,y3) = xy(i+10)
line(x1,y1,x2,y2)
line(x2,y2,x3,y3)
line(x3,y3,x1,y1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment