fractalkitty looking for math? fractalkitty.com

100 days of code

wavyDots

#trig#interactive#animation#math#wave

let n=10;
function setup(){
  createCanvas(600,600);
  fill(250);
  angleMode(DEGREES)
}
function draw(){
  background(0);
  translate(width/2,height/2)
  d=width/n;
  t=frameCount/10;
  for(let i=0;i<n+1;i++){
    for(let j=0;j<n+1;j++){
      fill(255);
      push();
      circle(-width/2 +i*d+d/3*sin(t*j)*sin(t*j),-width/2 +j*d+d/3*cos(t*j)*cos(t*j),d/3);
      pop();
    }
  }
}
function mousePressed(){
  n=n+3;
  if (n>60){
    n=10;
  }
}