fractalkitty looking for math? fractalkitty.com

early works

vertex

#random#interactive#animation#accumulates

pArray

let pArray = [];
let n = 1;
let p = 2;
function setup() {
  createCanvas(windowWidth, windowHeight);
  pArray[0] = [];
  pArray[1] = [];
  pArray[0][0] = random(-width / 2, 0);
  pArray[1][0] = 0;
  angleMode(DEGREES);
  background(50, 50, 60);
  noStroke();
}

function draw() {
  t = frameCount;

  fill(255, 255, 255, 90);
  translate(width / 2, height / 2);
  for (let i = 0; i < n; i++) {
    x = pArray[0][i] + (t % 500);
    y = pArray[1][i] + ((t % 10) * (t % 500)) / 50;
    circle(x / p, y, 2);
    circle(-x / p, -y, 2);
    circle(x / p, -y, 2);
    circle(-x / p, y, 2);
  }
  if (frameCount % 500 === 0) {
    p = random(1, 5);
  }
}

function mousePressed() {
  pArray[0][n] = mouseX - width / 2;
  pArray[1][n] = mouseY - height / 2;
  n++;
}

function keyPressed() {
  n = 1;
  p = 2;
  pArray[0] = [];
  pArray[1] = [];
  pArray[0][0] = random(-width / 2, 0);
  pArray[1][0] = 0;
  background(50, 50, 60);
}