fractalkitty looking for math? fractalkitty.com

early works

Shrinking_Ls

#random#math#geometry

var  x2 = 200, y2 = 200;
function setup() {
  createCanvas(400, 400);
  background(60);
  frameRate (9);
}

function draw() {
  stroke(random(20), random(255), 255)
  strokeWeight(100-frameCount/3);//shrinking line width with each frame
  x1 = random(400);//random x1 value
  y1 = random(400);//random y1 value
  x2 = random(400);
  y2 = random(400);
  line1 = line(x1,y1,x2,y2)
  m1 = (y2-y1)/(x2-x1);
  b1 = y1-x1*m1
  m2 = -1/(m1)
  b2 = y1-x1*m2
  line(x2,m2*x2+b2,x1,m2*(x1)+b2)
  if(frameCount >300){
    noLoop();
  }
}