If I have a sphere with center (x,y,z) and radius r, do an algorithm exist for placing X number of points (x,y,z) inside the sphere in such as way that the minimal distance to each other point is maximized?
E.g. one points would simply be placed in the middle, two points would be placed on the opposite borders, three points would be placed in a "triangle" formation on the border and so on.
As have been pointed out, an equal distance to each other point cannot be found for every number of points. The requirement is therefore to maximize the minimal distance between the points.
Update:
The following code generates points inside a sphere with radius 1.0, but does not maximize the distance.
function getPoint() {
var d, x, y, z;
do {
x = Math.random() * 2.0 - 1.0;
y = Math.random() * 2.0 - 1.0;
z = Math.random() * 2.0 - 1.0;
d = x*x + y*y + z*z;
} while(d > 1.0);
return {x: x, y: y, z: z};
}
I think I need some kind of iteration afterwards. I have tried to apply a force model using the n-body problem as inspiration, and while fun to watch, it didn't really work that well.