We can get $n$ equidistributed points in the unit circle using CirclePoints. But how do you get $n$ equidistributed points on the unit sphere(surface of a ball)? The preliminary idea is to suppose that the points are some electric charges with same electric quantity on a sphere. And they have the same effective working area. I think their position is what I want. This is my current solution:
point = RandomPoint[Sphere[], 10^6];
Graphics3D[{Sphere[], Blue, PointSize[.02], 
  Point[Union[point,SameTest -> (EuclideanDistance[#1, #2] < 0.4 &)]]}, 
 Boxed -> False]

But this solution cannot draw the specified number of points, and the space is not very equidistributed in some places.
Answer
Aha~ I suppose this question is created while solving this. Am I correct @yode :P
So here's an easy solution, simple, elegant, and may I say even quite fast after some optimization?
pt = With[{p = 
     Table[{x[i], y[i], z[i]}, {i, 80(*number of charges*)}]}, 
   p /. Last@
     NMinimize[
      Total[1/Norm[Normalize[#1] - Normalize[#2]] & @@@ 
        Subsets[p, {2}]], Flatten[p, 1]]];
Graphics3D[{Opacity@.3, Darker@Green, Sphere[], Opacity@1, 
  PointSize@Large, Darker@Blue, Point@*Normalize /@ pt}]
The result is quite good:
the setting of the minimization variable is crucial, or the point will not be on surface. But fortunately, our 'kindergarten physics' taught us that when charges are freely scattering in a sphere, they'll always be on surface evenly! Thus this must be some sort of 'most even' form of scattering as it follows physical laws.

Comments
Post a Comment