fractalkitty looking for math? fractalkitty.com

all

cardioid

#trig#vectors#animation#math

let p=[]
let cnt=0;
let t=0;
function setup(){
  createCanvas(500,500)
  noFill()
  angleMode(DEGREES)
}
function draw(){
  background(0,0,20)
  stroke(255);
  t+=0.5
  translate(width/2,height/2);
  circle(0,0,100);
  circle(100*sin(t),100*cos(t),100);
  p[cnt]=createVector(100*sin(t)+50*sin(t*2),100*cos(t)+50*cos(t*2))
  line(100*sin(t),100*cos(t),p[cnt].x,p[cnt].y);
  stroke(0,200,250)
  for(let i=0;i<cnt;i++){
    circle(p[i].x,p[i].y,2)
  }
  cnt++
  
  
}