How to plot N points on the surface of a D-dimensional sphere roughly equidistant apart?
3d, graphics, math, trigonometry, vector-graphics
Solution
Several options :
Randomly throw points on the sphere and use a Lloyd relaxation to make them uniformly spread : you iteratively compute their Voronoi diagram and move them toward the center of their Voronoi cell (instead of working on the sphere, you may want to use an euclidean voronoi diagram restricted to the sphere : CGAL can fo that for instance, or refer to my article).
If a rough approximation is fine (ie., if a uniformly random distribution is good enough), you can use the formula explained on Wiki : N-Sphere . If not, you can still use this random sampling as the initialization of the method above
For a still random but better notion of equidistant samples, you can generate a Poisson-disk distribution. Fast code in high dimension is available at Robert Bridson's homepage . You may need to adapt it for a spherical domain though.
Problem
Let's say I have a D-dimensional sphere with center, [C1, C2, C3, C4, ... CD], and a radius R. Now I want to plot N number of points evenly distributed (equidistant apart from each other) on the surface of the sphere. It doesn't matter where those points are exactly, just that they are ROUGHLY equidistant from each other. I want a function that returns an array of these points, P. ``` function plotter(D, C[1...D], R, N) { //code to generate the equidistant points on the sphere return P[1...N][1...D]; } ```