> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.y-iFIbH4u6o/rev.146
 * 
 * authors: 
 *   frederic.vernier

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



void setup(){
  colorMode(HSB, 255);
  size(300, 300);
  //noLoop();
  frameRate(25);
  smooth();
}

int N=60;
int R=100;
int dR = 5;
int t=0;
void draw(){
  background(255);
  t++;
  for (int R=0; R<width/2; R+= dR){
    strokeWeight(1+0.5*log(R+1));
    for (int i=0; i<N; i++){
      float x0 = width/2+R*cos(i*2*PI/N+t/10);
      float y0 = height/2+R*sin(i*2*PI/N+t/10);
      float x1 = width/2+(R+dR)*cos((i+1)*2*PI/N+t/10);
      float y1 = height/2+(R+dR)*sin((i+1)*2*PI/N+t/10);
      stroke(((i+(1+sin(t/10.0))*R/dR)%N)*255/N, 32+R*196/(width/2), 192+(i%2)*50);
      line(x0, y0, x1, y1);
    }
  }
}