fractalkitty looking for math? fractalkitty.com

early works

LacedReflections

#interactive#animation#accumulates#tool#symmetry#weather

nRefcnvsmySelectEventsaveF

var nRef = 6 ;
let cnvs;

function setup() {
  c=min(windowWidth,windowHeight)*0.85;
  cnvs = createCanvas(c,c);
  sel = createSelect();
  sel.position(10, width+10);
  for(i = 1;i<43;i++){
    sel.option(i);
  }  
  sel.selected(6);
  sel.changed(mySelectEvent);
  button = createButton('save');
  button.position(60, width+10);
  button.mousePressed(saveF);
  angleMode(DEGREES)
  stroke(62, 133, 168);
  fill(62, 133, 168);
  background(255);
  theta = 360/nRef
  
}
function draw() { 
  r = 0.5
  translate(width/2,width/2)
  for (let i = 0;i<nRef;i++){
    push()
      rotate(i*theta)
      circle(mouseX-width/2,mouseY-width/2,r)
      push()
        scale(1, -1);
        circle(mouseX-width/2,mouseY-width/2,r)
      pop()
    pop()
    
  }
}

function keyPressed() {
background(255) 
}

function mySelectEvent(){
  background(255)
  nRef = sel.value();
  theta = 360/nRef
}

function saveF(){
  saveCanvas(cnvs, 'myReflect', 'jpg');
}