fractalkitty looking for math? fractalkitty.com

Mathober 2025

Monotonic

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

monotonicdrawGrid


let t = 0;
let n = 25;
let m = 6;
function setup() {
  createCanvas(500, 500);
  background(255);
  describe(
    "Staticky radial graph paper with spirals made of random dots that spin almost looking galactic"
  );
  rectMode(CENTER);
  strokeWeight(0.5);
  strokeCap(SQUARE);
}

function draw() {
  background(245, 250, 255, 20);
  translate(width / 2, height / 2);
  stroke(100, 110, 120, 10);
  drawGrid();
  v = 0;
  t += 0.007;

  monotonic();
  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 monotonic() {
  push();
  fill(40, 50, 60, 70);
  r = 0;
  for (let k = 0; k < m; k++) {
    push();
    rotate(((2 * PI) / m) * k);
    for (let j = 0; j < 5.1 * PI; j += random(0.1, 0.2)) {
      r = pow(j, 3) / 400 + random(0.01, 0.1);
      circle(
        (width / 25) * r * cos(j + t),
        (width / 25) * r * sin(j + t),
        random(0.5, 3)
      );
      r = pow(j, 3) / 400 + random(0.01, 0.1);
      circle(
        (width / 25) * r * cos(j + t),
        (width / 25) * r * sin(j + t),
        random(0.5, 3)
      );
    }
    pop();
  }
  pop();
}

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();
}