Skip to main content
2 of 15
edited tags
YCor
  • 63.9k
  • 5
  • 187
  • 286

Mapping a Cube to a Sphere

I have been looking for a way to map a unit cube ($x^{2}=y^{2}=z^{2}=1$) to a unit sphere ($R^{2}=1$) with minimal distortion of the great circles formed by mapping the coordinate lines on the cube face. As can be seen from the following picture, a simple radial contraction onto the sphere surface leads to large visible distortion of the great circles.

radial contraction onto sphere

Phil Nowell here derived an elegant mapping that generates a much more uniform subdivision of the great circles.

Nowell mapping

However, close inspection shows that there is still some room for improvement. Points near the center of the cube faces get more compressed than those near the edges.

By using the rotation of central planes to map points on the cube to equidistant points on the sphere, I was able to come up with the following expressions for an improved mapping:

$x_{sphere}=x_{c}/\sqrt{x_{c}^{2}+ y_{c}^{2}+ z_{c}^{2}}$

$y_{sphere}=y_{c}/\sqrt{x_{c}^{2}+ y_{c}^{2} + z_{c}^{2}}$

$z_{sphere}=z_{c}/\sqrt{x_{c}^{2}+ y_{c}^{2} + z_{c}^{2}}$

where

$x_{c}=\sqrt{x^{p}+y^{2}+z^{2}} tan(x\ atan(\frac{1}{\sqrt{x^{p}+y^{2}+z^{2}} } ))$

$y_{c}=\sqrt{x^{2}+y^{p}+z^{2}} tan(y\ atan(\frac{1}{\sqrt{x^{2}+y^{p}+z^{2}} } ))$

$z_{c}=\sqrt{x^{2}+y^{2}+z^{p}} tan(z\ atan(\frac{1}{\sqrt{x^{2}+y^{2}+z^{p}} } ))$

p is a large even number and x, y, z are the coordinates of the cube.

The picture below is obtained with p=50

improved mapping

To express the quality of the mapping, I calculate the ratio of the maximum and minimum length of a line segment on the most distorted great circle, as follows:

$quality = l_{min}/l_{max}$,

so that an optimum distribution gives a quality of 1.

With this, the quality of the radial contraction becomes 0.58, that of Nowell’s mapping becomes 0.79 and my improved mapping becomes 0.96. It is also worth noting that the quality on the central coordinate lines and the edges is 1.

Now, my question is: “can my mapping be improved further to yield a quality of 1 everywhere on the sphere?”