Created
July 3, 2020 08:48
-
-
Save almost/dbef13e153c284674a210b731efeec66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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