fractalkitty looking for math? fractalkitty.com

100 days of code

together

#trig#animation#math

conchoid

let a=0,x=0,b=0;
function setup(){
  cnv=createCanvas(windowWidth,windowHeight)
  background(255)
  stroke(255)
  noFill()
  strokeWeight(0.05)
  
}
function draw(){
  background(0,0,5)
  translate(width/2,height/2);
  noStroke()
  fill(255,255,255,40*sin(frameCount/200))
  circle(0,0,500)
  fill(5,5,5,50*sin(frameCount/200))
  circle(-50*sin(frameCount/300),50*cos(frameCount/100),500)
  
  noFill()
  stroke(200-100*sin(frameCount/100),205+100*cos(frameCount/100),255)
  for(let i=-3;i<=3;i++){
   conchoid(a+i,b+i)
  }
  a=5*sin(frameCount/200)
  b=5*cos(frameCount/200)
  
} 
function conchoid(a,b){
  beginShape();
  for(let i=0;i<356;i++){
    y=width/60*((a*tan(i)+b*cos(i))/sin(i));
    x=width/60*(b/cos(i)+a*tan(i))/sin(i);
    vertex(y,x)
  }
  endShape()
}