fractalkitty looking for math? fractalkitty.com

100 days of code

projectiveLine

#random#animation#math#number-theory#topology

function setup(){
  createCanvas(600,600);
  noFill()
  background(0);
  frameRate(10);
}
function draw(){
  background(0,0,0,5)
  translate(width/2,height/2);
  noFill()
  stroke(255);
  strokeWeight(1)
  line(0,-height/2,0,height/2);
  line(-width/2,0,width/2,0);
  circle(0,-100,200);
  strokeWeight(0.1);
  x=random(-width/2,width/2);
  y=random(-height/2,height/2);
  m=y/x;
  line(-width/2,-m*width/2,width/2,m*width/2);
  xInt=-m*100*2/(m*m+1)
  yInt = -(200+sqrt(40000-4*xInt*xInt))/2
  yInt2 = -(200-sqrt(40000-4*xInt*xInt))/2
  fill(150,180,255)
  circle(xInt,yInt,5);
  circle(xInt,yInt2,5)
  
}