fractalkitty looking for math? fractalkitty.com

100 days of code

zoomCircles_Day11

changeSize

let h = 2,k=400,cnv;
function setup() {
  cnv = createCanvas(600, 600);
  cnv.mouseWheel(changeSize);
  noLoop()
  angleMode(DEGREES)
  strokeWeight(0.1)
}

function draw() {
  background(255);
  t = frameCount%360;
  fill(255,255,255,010)
  for(let i=0;i<=width/k;i++){
    for (let j=0;j<=width/k;j++){
      fill(0,0,255,(k/8)*i+(k/8)*j)
      dx = width/h-k*i;
      dy = width/h-k*j;
      circle(k*i,k*j,k*2)
    }
  }
}
function changeSize(event) {
  if (event.deltaY > 0 && k>0.1) {
    k = k*0.9
  } else if (k<width-100){
    k = k/0.9;
  }
  draw();
}