function setup() { createCanvas(800, 800); angleMode(DEGREES); } function draw() { background((95 / 100) * 255); push(); translate(width / 2, height / 2); let ratio = 0; let angle_num = 4; for (let i = 0; i < 10000; i++) { let bool = random() > 0.5; let angle = (int(random(angle_num)) * 360) / angle_num + ((recursiveRandom(angle_num, bool) - 0.5) * 360) / angle_num / 2; let n = recursiveRandom(random(0, 5), bool); let r = 200 * n; let x = cos(angle) * r * (bool ? 1 - ratio : 1 + ratio); let y = sin(angle) * r * (bool ? 1 - ratio : 1 + ratio); strokeWeight(2 - abs(n - 1) * 2); point(x, y); } pop(); noLoop(); } function recursiveRandom(count, bool = true) { let n = 1; while (count > 0) { n *= random(); count--; } return bool ? 1 - n : 1 + n; }