# Spherical coordinates¶

## Definition¶

The frame used in NeuroM was chosen so that the biological features are easy to derive from the coordinate values. Nevertheless, these coordinates are not the standard spherical coordinates and are thus detailed here.

The NeuroM frame has two coordinates, namely the elevation and the azimuth. While the two coordinates of the usual spherical frame are $$\theta$$ and $$\phi$$.

The following figure compares the NeuroM frame to the standard spherical frame:

The point $$P$$ is located at $$(x, y, z)$$ in cartesian coordinates and $$O$$ is the frame center.

The elevation is the angle between the vector $$\vec{OP}$$ and the vector $$\vec{OP_{xz}}$$, where $$P_{xz}$$ is the projection of $$P$$ on the plane $$xz$$.

The azimuth is the angle between the $$X$$ axis and the vector $$\vec{OP_{xz}}$$.

## Transformations¶

The transformation from cartesian coordinates to this frame is the following:

$\begin{split}\text{elevation} &= \arcsin(y / \sqrt{x^2 + y^2 + z^2}) \\ \text{azimuth} &= \arctan(z / x)\end{split}$

The transformation from this frame to cartesian coordinates is the following:

$\begin{split}x &= \Vert \vec{OP} \Vert \cos(\text{elevation}) \times \cos(\text{azimuth}) \\ y &= \Vert \vec{OP} \Vert \sin(\text{elevation}) \\ z &= \Vert \vec{OP} \Vert \cos(\text{elevation}) \times \sin(\text{azimuth})\end{split}$

The transformation from this frame to usual spherical coordinates is the following:

$\begin{split}\theta &= \arccos \left( \sin(\text{azimuth}) \times \cos(\text{elevation}) \right) \\ \phi &= \arctan \left( \dfrac{\tan (\text{elevation})}{\cos (\text{azimuth})} \right)\end{split}$

The transformation from usual spherical coordinates to this frame is the following:

$\begin{split}\text{elevation} &= \arcsin \left( {\sin{\theta} \times \sin{\phi}} \right) \\ \text{azimuth} &= \arctan \left( {\dfrac{1}{\tan{\theta} \times \cos{\phi}}} \right)\end{split}$