How to generate a equally distant point grid on a sphere?

1.2k Views Asked by At

I have a sphere (that is earth) and I would like to generate equally distant point all around it. so that it will looks like a grid :

https://i.stack.imgur.com/k8rp4.png

I have a current code implementation where I use =>

s = 0
t = 0
(from t = 0 to t = 2PI)
   s = 0
   (from s = 0 to s = PI)
       x = cos(t) * sin(s)
       y = sin(t) * sin(s)
       z = cos(t)
   s += 0.1
t+= 0.1

Exemple of my current code

The problem I have is The code is covering only a small part of earth, and the point are not really all equidistant, there is a higher density on the poles.

I was searching for multiple algorithms, but I don't find any to create equidistant point.

The next step after this would be to convert those lat/long point using mercator to project them on a 2d map.

1

There are 1 best solutions below

2
On BEST ANSWER

Generating an equidistant point grid on a sphere, where the points are allowed to be arbitrarily close together, is impossible. This is the same problem as the map projection problem.

If we could generate a point grid of arbitrary fineness, we could convert the points to coordinates on the plane, creating a map projection with no distortion. It is known that no map projection exists that doesn't distort areas.

That said, probably your best option is to pass to a projection (one that minimizes area distortions for your region of interest), plot a grid a points, and convert those points back to coordinates on a sphere.