Tomographer  v5.4
Tomographer C++ Framework Documentation
Hyperspherical Coordinates

In N-dimensional Euclidian real space, we represent points with their cartesian coordinates x_i.

The Hyperspherical Coordinates is another representation for these points, with the new coordinates \( (r,\theta_1,\theta_2,\ldots,\theta_{N-1}) \) :

\begin{align*} r &\in [0,\infty[ \ ; \\ \theta_i &\in [0,\pi] \qquad\text{ for } i=1,\ldots,N-2 \ ; \\ \theta_{N-1} &\in [-\pi,\pi[ \ . \end{align*}

Routines that allow to compute the coordinate transforamtions, as well as corresponding jacobian and "differential" jacobian, are defined in tomographer/mathtools/sphcoords.h.

The transformation to cartesian coordinates is given by:

\begin{align*} x_1 &= r\,\cos\left(\theta_1\right) \ ;\\ x_2 &= r\,\sin\left(\theta_1\right)\cos\left(\theta_2\right) \ ;\\ & \ldots \\ x_{N-1} &= r\,\sin\left(\theta_1\right)\ldots\sin\left(\theta_{N-2}\right)\cos\left(\theta_{N-1}\right) \ ;\\ x_{N} &= r\,\sin\left(\theta_1\right)\ldots\sin\left(\theta_{N-2}\right)\sin\left(\theta_{N-1}\right) \ . \end{align*}

Note
In the special case of the 2-sphere, this does not map back to usuall 3-D spherical coordinates (i.e., with \(\theta=0\) at (X=0,Y=0,Z=1), \(\theta=\pi\) at (X=0,Y=0,Z=-1), and \((\theta=\pi/2, \phi=0)\) for (X=1,Y=0,Z=0)). In fact, the mapping for 3-dimensional Euclidean space is:

\begin{align*} x_1 &= r \cos\left(\theta_1\right) & &\text{ -- what we normally call Z;} \\ x_2 &= r \sin\left(\theta_1\right) \cos\left(\theta_2\right) & &\text{ -- what we normally call X;} \\ x_3 &= r \sin\left(\theta_1\right) \sin\left(\theta_2\right) & &\text{ -- what we normally call Y.} \end{align*}

So effectively, the angles count from (X=+1,Y=0,Z=0) and \(\theta_1\) increases to (X=-1,Y=0,Z=0); then \(\theta_2\) wraps around, with \(\theta_2=0\) corresponding to the direction in which Y=+1.