Posts

Showing posts from May, 2023

Mapping a Cube to a Sphere

Image
I have been looking for a way to map a unit cube (with vertices $x^{2}=1$, $y^{2}=1$, $z^{2}=1$) to a unit sphere ($x^{2}+y^{2}+z^{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.  Phil Nowell ( mapping-cube-to-sphere ) derived an elegant mapping that generates a much more uniform subdivision of the great circles. 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 the coordinates of the sphere: $x_{sphere}=\frac{x_{c}}{\sqrt{x^{2}_{c}+y^{2}_{c}+z^{2}_{c}} } $ $y_{sphere}=\frac{y_{c}}{\sqrt{x^{2}_{c}+y^{2