fractalkitty looking for math? fractalkitty.com

Mathober 2025

Chi

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

deltdrawGrid

let t = 0;
let n = 25;
let delt = 1.5;
function setup() {
  createCanvas(500, 500);
  background(255);
  describe(
    "a spiral on radial graph paper that is slowly drawn smaller and smaller. It is made by graphing the chi function at higher and higher orders on polar coordinates. "
  );
  rectMode(CENTER);
  strokeWeight(0.5);
}

function draw() {
  background(245, 250, 255, 20);
  translate(width / 2, height / 2);
  stroke(100, 110, 120, 10);
  drawGrid();
  v = 0;
  t += 0.1;
  noFill();
  push();
  strokeWeight(2);
  for (let v = 0; v < t % 20; v++) {
    stroke(235 - v * 5, 245 - v * 5, 255 - v * 5);
    beginShape();
    for (let z = 0; z < 10 * PI; z += 0.1) {
      sum1 = 0;
      for (let k = 0; k < 40; k++) {
        sum1 = sum1 + pow(z, 2 * k + 1) / pow(2 * k + 1, v);
      }
      r = log(sum1);
      vertex(r * cos(z), r * sin(z));
    }
    endShape();
  }
  pop();
  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);
  }
}