right, if the points are distributed in a square then the distribution looks more like what one would expect:
(i am to lazy to register to make a fork, here is the code change):
replace:
let a = random(Math.PI*2);
let r = d * (1 - random());
point(cos(a)*r, sin(a)*r);
with: let x = random(d);
let y = d * (1 - random());
point(x, y);
in every blockyou could even simplify it to:
let x = random(d);
let y = random(d);
point(x, y);
and for more fun apply the nested random() call to both axis: let x = random(random(d));
let y = random(random(d));
point(x, y);