Skip to content

Instantly share code, notes, and snippets.

@companje
Created May 21, 2012 22:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save companje/2765118 to your computer and use it in GitHub Desktop.
Save companje/2765118 to your computer and use it in GitHub Desktop.
Fibonacci Spiral in Processing
float phi = (sqrt(5)+1)/2;
size(323,200);
translate(height/phi,0);
scale(height);
noStroke();
smooth();
for (float i=0; i<10; i++) {
fill(i/10*255);
rect(0,0,1,1);
fill(255,255,0,150);
arc(0,0,2,2,0,PI/2);
scale(1/phi);
rotate(PI/2);
translate(1/phi,0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment