## Conversion of coordinates

### Spherical coordinates

• $x = r \sin(\vartheta) \cos(\varphi)$
$y = r \sin(\vartheta) \sin(\varphi)$
$z = r \cos(\vartheta)$
• $r = \sqrt{x^{2} + y^{2} + z^{2}}$
$\tan(\varphi) = y / x$
$\cos(\vartheta) = z / r$
• $0 \le \varphi < 2 \pi$
$0 \le \vartheta \le \pi$

### Hammer-Aitoff projection

• $x = \sqrt{8} \cos(\varphi) \sin(\lambda / 2) / \sqrt{1 + \cos(\varphi) \cos(\lambda / 2)}$
• $y = \sqrt{2} \sin(\varphi) / \sqrt{1 + \cos(\varphi) \cos(\lambda / 2)}$

Here, $\lambda = {-180^{\circ}} \ldots {+180^{\circ}}$ is the longitude and $\varphi = {-90^{\circ}} \ldots {+90^{\circ}}$ the latitude in the original coordinate system. The resulting coordinates $x$ and $y$ are in the range of $\pm \sqrt{8}$ and $\pm \sqrt{2}$, respectively.

### Galactic coordinates

Equatorial coordinates, ($\alpha$, $\delta$), can be converted into Galactic coordinates, ($l$, $b$), via

\begin{equation*} \tan(l_{0} - l) = \frac{\cos(\delta) \sin(\alpha - \alpha_{0})}{\sin(\delta) \cos(\delta_{0}) - \cos(\delta) \sin(\delta_{0}) \cos(\alpha - \alpha_{0})} \end{equation*}

and

\begin{equation*} \sin(b) = \sin(\delta) \sin(\delta_{0}) + \cos(\delta) \cos(\delta_{0}) \cos(\alpha - \alpha_{0}) \end{equation*}

Here, $\alpha_{0}$ and $\delta_{0}$ are the equatorial coordinates of the Galactic north pole, while $l_{0}$ is the Galactic longitude of the equatorial north pole. In the case of J2000.0 coordinates we get

\begin{eqnarray*} \alpha_{0} & \approx & 192.8595^{\circ} \\ \delta_{0} & \approx & \phantom{0}27.1284^{\circ} \\ l_{0} & \approx & 122.9320^{\circ} \end{eqnarray*}

In the case of B1950.0 coordinates the constants to be used are

\begin{eqnarray*} \alpha_{0} & = & 192.25^{\circ}~\text{(exact)} \\ \delta_{0} & = & \phantom{0}27.40^{\circ}~\text{(exact)} \\ l_{0} & = & 123.00^{\circ}~\text{(exact)} \end{eqnarray*}

In the latter case the constants are exact because the definition of the Galactic coordinate system was originally based on the B1950 coordinate system.

Note that the transformation equations above are generally valid for the conversion between any two celestial coordinate systems. Only the constants will need to be adjusted to reflect the desired source and target coordinate systems.

### Magellanic coordinates

A suitable Magellanic coordinate system was formally introduced by Nidever, Majewski, & Burton (2008). They defined the Magellanic north pole to have the Galactic coordinates $(l, b) = (188.5^{\circ}, {-7.5^{\circ}})$ and the LMC to have a Magellanic longitude of $0^{\circ}$. Following their definition, the conversion between Galactic coordinates, $(l, b)$, and Magellanic coordinates, $(\lambda, \beta)$, is given by

\begin{equation*} \tan(\lambda - \lambda_{0}) = \frac{\sin(b) \sin(\varepsilon) + \cos(b) \cos(\varepsilon) \sin(l - l_{0})}{\cos(b) \cos(l - l_{0})} \end{equation*}

and

\begin{equation*} \sin(\beta) = \sin(b) \cos(\varepsilon) - \cos(b) \sin(\varepsilon) \sin(l - l_{0}) \end{equation*}

where $l_{0}$ and $\lambda_{0}$ are the respective longitudes of the point where the Galactic and Magellanic equators intersect, and $\varepsilon$ is the inclination between the two equators. The choice of coordinates by Nidever, Majewski, & Burton (2008) implies the following constants:

\begin{eqnarray*} l_{0} & = & 278.5000^{\circ}~\text{(exact)}\\ \lambda_{0} & \approx & \phantom{0}32.8610^{\circ} \\ \varepsilon & = & \phantom{0}97.5000^{\circ}~\text{(exact)} \end{eqnarray*}

In the resulting coordinate system the LMC is at $\lambda = 0^{\circ}$, the Leading Arm has positive Magellanic longitudes, and the trailing Magellanic Stream covers the range of negative longitudes. The stream is generally confined to the equatorial region of $|\beta| \lesssim 10^{\circ}$, with a slightly larger scatter of ${-30^{\circ}} \lesssim \beta \lesssim {+10}^{\circ}$ for the Leading Arm.

### Conversion from heliocentric to Galactocentric distance

Distances to astronomical objects beyond the Solar System are usually heliocentric, i.e. with respect to the Sun. However, Galactocentric distances are sometimes required. Heliocentric distances can be easily converted to Galactocentric distances by subtracting the heliocentric space vector of the Galactic centre, $\vec{R}_{0}$, from the heliocentric space vector of the object under study, $\vec{R}_{\rm hel}$, thus

\begin{equation*} \vec{R}_{\rm gal} = \vec{R}_{\rm hel} - \vec{R}_{0} \end{equation*}

where

\begin{equation*} \vec{R}_{\rm hel} = \begin{pmatrix} d \cos(b) \cos(l) \\ d \cos(b) \sin(l) \\ d \sin(b) \end{pmatrix} , \qquad{} \vec{R}_{0} = \begin{pmatrix} R_{0} \\ 0 \\ 0 \end{pmatrix} \end{equation*}

with $R_{0}$ being the distance of the Sun from the Galactic centre and $l$, $b$ and $d$ the Galactic longitude, Galactic latitude and heliocentric distance, respectively, of the object under study. Hence, the distance of the object from the Galactic centre is given as

\begin{equation*} |\vec{R}_{\rm gal}| = \sqrt{[d \cos(b) \cos(l) - R_{0}]^{2} + d^{2} \cos^{2}(b) \sin^{2}(l) + d^{2} \sin^{2}(b)} \, . \end{equation*}

This result is generally valid for all possible object positions irrespective of whether they are inside or outside the Solar circle.