Created
October 22, 2016 02:15
-
-
Save jromeem/1fdabe48137d208bf8f217e3d889d3f0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
int numFlorets = 500; | |
float angleFloret = 137.5; | |
int scaleFloret = 15; | |
void setup() { | |
size(500,500); | |
} | |
void draw() { | |
background(255); | |
translate(width/2, height/2); | |
for (int i=0; i<numFlorets; i++) { | |
float radius = scaleFloret*sqrt(i); | |
float angle = i*angleFloret; | |
float posx = radius*cos(angle); | |
float posy = radius*sin(angle); | |
fill(0); | |
ellipse(posx, posy, 10, 10); | |
} | |
angleFloret = angleFloret + 0.0001; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment