View the code ⇓

Vonal: Variation on a theme by Victor Vasarely

int NUM=24,k;
float t, h;

void setup(){
  size(600,600); colorMode(HSB,360,100,100);
  t=-1; int i; k=0; noStroke(); h=240;
}
void draw(){
  float x1,x2,y1,y2;
  int i=0;color swap; h=(h+0.03)%360;
  background(h,60,((i+k)%2)*(100));
  t+=0.01;
  for(i=1;i<=NUM;i++){
    fill(h,60,((i+k)%2)*(80+20*cos(2*PI*i/(NUM*1.0))));
    x1=width/(NUM*1.0)/2*(t+i); x2=width-x1;
    y1=width/2/log(NUM+1)*(log(NUM+1)-log(NUM+1-(t+i)));
    y2=width-width/2/log(NUM+1)*log(1+t+i);
    rect(x1,y1,x2-x1,y2-y1);
  }
  if(t>0){t--; k++;}
}

Return to top ⇑