Fibonacci sphere algorithm. Generates points distributed on a sphere.
Optional
for (const pt of sphereFibonacci(100)) { // pt.x, pt.y, pt.z} Copy
for (const pt of sphereFibonacci(100)) { // pt.x, pt.y, pt.z}
const sphere = { radius: 10, x: 10, y: 200 }const pts = [...sphereFibonacci(100, 0, sphere)]; Copy
const sphere = { radius: 10, x: 10, y: 200 }const pts = [...sphereFibonacci(100, 0, sphere)];
Source: https://codepen.io/elchininet/pen/vXeRyL
Fibonacci sphere algorithm. Generates points distributed on a sphere.