fractalkitty looking for math? fractalkitty.com

all

moire piriforms

#trig#animation#math#parametric

piriform

let t
function setup(){
  createCanvas(windowWidth,windowHeight);
  angleMode(DEGREES);
  stroke(155, 193, 204);
  background(0)
}
function draw(){
  background(0,0,0,2)
  t1 = 100*sin(frameCount/2)
  strokeWeight(0.5)
  translate(width/2,height/2);
  for (let i = 0;i<30;i++){
    stroke(155-t1/2, 193-t1/2, 204-t1/3);
  fill(0,0,0,10)
  piriform(80-2*i,50-i,120-3*i,50,5)
  }
  
  
  
}
function piriform(a,b,c,d,r){
  a=a+c*sin(frameCount/8);
  b=b-d*sin(frameCount/20);
  rotate(frameCount/4/r)
  beginShape()
  for(let t=0;t<361;t++ ){
    x	=	a*(1+sin(t))	
  y	=	b*cos(t)*(1+sin(t));
    vertex(y,x)
  }
  endShape(close)
}