> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.GBrlOh1XOBA/rev.443
 * 
 * authors: 
 *   Felix Woitzel

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// This sketch builds on a prior work, "Sunflower Pattern", created by Felix Woitzel
// http://studio.sketchpad.cc/sp/pad/view/ro.9yc$gOWRZwqvl/rev.3

float theta = (1+sqrt(5))/2;

int num = 400;
float v = 0.05;
float s = 64.;
float w = 1.5;

void setup() {  // this is run once.   
  size(512, 512);
  frameRate(60);

  strokeWeight(w);
  stroke(256, 256, 256, 128);
}


void draw() {  // this is run repeatedly.  

  background(0);
  fill(256);

  for ( int d = 0; d < num; d++) {
    float l = (float)d/(float)(num-1);
    l = l + millis()/1000*v;
    l = l - floor(l);
    
    pushMatrix();
    translate(width/2, height/2);
    rotate(-d*theta*4);
    translate(l*l*width/2, 0);

    float e = l*s;
    ellipse(0,0,e,e);    
    popMatrix();
  }
}