fractalkitty looking for math? fractalkitty.com

Genuary 2026

genuary - day 14

#random#trig#animation#accumulates#genuary

points

let points = [];
let r;
let n = 2000;
let t = 0;
function setup() {
  createCanvas(600, 600);
  r = width / 3;
  fill(80, 160, 180, 50);
  describe(
    "light and dark particles that dance and move slowly to slowly fill in a circle with a concentration of black particles in the center. the sketch draws on top of itself so all the line made by the particles create a complex hash texture on a slate background."
  );
  for (let i = 0; i < n; i++) {
    points[i] = {
      r: random(0, r),
      theta: random(0, 2 * PI)
    };
  }
  noStroke();
}

function draw() {
  t = 2 * PI * cos(frameCount / 400);
  translate(width / 2, height / 2);
  for (let i = 0; i < points.length; i++) {
    let a = points[i].theta;
    let m = points[i].r / 110 + 0.5 * cos(t - a);
    fill(80 * m, 160 * m, 180 * m, 40);
    x =
      points[i].r *
      cos(a - t + i / a) *
      sin((a / 2) * t * pow(-1, i % 2) - a + i / a);
    y =
      points[i].r *
      sin(a - t + i / a) *
      cos(10 / (max(1, a) * t * pow(-1, i % 2)));
    circle(x, y, 2);
  }
}