fractalkitty looking for math? fractalkitty.com

Mathober 2025

Amalgamation

#random#trig#grid#interactive#animation#math#polar#mathober

domaindrawGrid


let t = 0;
let n = 25;
let rs;
let domain;

function setup() {
  domain = [-2 * PI, 2 * PI];
  createCanvas(500, 500);
  background(255);
  describe(
    "spokes drawn with random points on radial graph paper with a circle in the center indicating a circular trend even though each spoke goes in its own direction."
  );
  rectMode(CENTER);
  strokeWeight(0.5);
  strokeCap(SQUARE);
  rs = [];
}

function draw() {
  background(245, 250, 255, 20);
  translate(width / 2, height / 2);
  stroke(100, 110, 120, 10);
  drawGrid();
  t += 0.002;
  r = width / 50;
  stroke(90, 100, 110, 150);
  noFill();

  a = (2 * PI) / 50;
  for (let i = 0; i < 50; i += 2) {
    for (let j = 0; j < 100; j++) {
      r1 = random((width / 25) * 3, (width / 20) * 9);
      dT = randomGaussian(0, 0.01);
      circle(r1 * cos(i * a + dT), r1 * sin(i * a + dT), 2);
    }

    circle(0, 0, (width / 25) * 14);
  }

  strokeWeight(1);
  noFill();
  stroke(100, 110, 120, 30);
  rect(0, 0, width / 1.02, width / 1.02);
  rect(0, 0, width / 1.04, width / 1.04);
}

function drawGrid() {
  for (let i = 0; i < n; i++) {
    rotate((2 * PI) / n);
    line(-width / 1.5, 0, width / 1.5, 0);
    circle(0, 0, (width / n) * 2 * i);
  }
  noStroke();
  for (let i = 0; i < 500; i++) {
    x = random(-width / 2, width / 2);
    y = random(-width / 2, width / 2);
    fill(245, 250, 255, 150);
    circle(x, y, 2);
  }
}

function mousePressed() {
  setup();
  draw();
}