const simplex = new SimplexNoise();
// ...
const noise2 = simplex.noise2D(x , y);
const noise3 = simplex.noise3D(x , y, time);
// a^2 + b^2 = c^2
// Circle 1 at (x1, y1) with r1
// Circle 2 at (x2, y2) with r2
const a = x1 - x2;
const b = y1 - y2;
const c = Math.hypot(a, b);
// const c = Math.sqrt(a*a + b*b);
if(c > r1 + r2) {
// outside
} else {
// intersecting or inside
}
Albert Einstein
Robert Brown
Jean Perrin