Figure out the location of celestial objects relative to the Milky Way in x, y, z co-ordinates I am trying to place various celestial objects the correct distance from the Milky Way, using x, y, z co-ordinates.
So assuming the centre-of-mass of the Milky Way is at 0, 0, 0 - how can I figure out where to place a galaxy or star given it's celestial coordinates?
I'm just an amateur, and pushing 60 years old, so please excuse me if I have something wrong here...
The spherical $(r, l, b)$ can be converted to
rectangular
$(U, V, W)$ as:
$$\begin{align}
U &amp;= r \cos b \cos l \\
V &amp;= r \cos b \sin l \\
W &amp;= r \sin b
\end{align}$$
Using $(r, l, b) = (770 \pm 40 ~\text{kpc}, 121.2^\circ, -21.6^\circ)$,
$$\begin{align}
U &amp;= -371 \mp 19 ~\text{kpc} \\
V &amp;= ~~~ 612 \pm 32 ~\text{kpc} \\
W &amp;= -283 \mp 15 ~\text{kpc}
\end{align}$$
That's relative to the Sun.
For a position relative to the center of our galaxy,
subtract $8 \pm 0.5 ~\text{kpc}$ from $U$.