Lets say I have galactic coordinates of an object, l and b.

I figured out that i can transform them to cartesian system using the formula:

$$ \begin{align} X &= \cos(b)\cos(l)\\ Y &= \cos(b)\sin(l)\\ Z &= \sin(b) \end{align} $$

Giving me a vector on the celestial sphere. So far so good, now I want to know the exact position of the object. Using 1/parallax, I compute the distance. Therefore I multiply it with my vector to find out the exact cartesian position of the object.

$$ \begin{align} X &= \textstyle\frac{1}{p} \cos(b)\cos(l)\\ Y &= \textstyle\frac{1}{p} \cos(b)\sin(l)\\ Z &= \textstyle\frac{1}{p} \sin(b) \end{align} $$ What I want to know is if this calculation is correct and if not, what do I have to change or reconsider? Thanks!

  • $\begingroup$ The question for me is : what problem do you solve by conversion from galactic to (which?) Cartesian coordinates? Galactic coordinates or heliocentric seem more appropriate when dealing with galactic objects $\endgroup$ Commented Mar 21, 2020 at 1:18
  • $\begingroup$ I want to see how the planets are contributed in the cartesian coordinate system. The first transformation only gives me, from my understanding, the positions on the sphere. I want the exact positions with the distance from the centre. $\endgroup$
    – JackJohn
    Commented Mar 21, 2020 at 10:41
  • $\begingroup$ If I'm understanding correctly, you're looking for precise distance from the center of the galaxy. Unfortunately, we don't know the distance to the center of the galaxy with high precision, so galactic coordinates are centered on our solar system's barycenter. $\endgroup$
    – user21
    Commented Mar 21, 2020 at 16:58
  • $\begingroup$ I'm actually trying to do so from the barycenter. Is it possible that I should use the Radius of the sun instead of 1/P? $\endgroup$
    – JackJohn
    Commented Mar 21, 2020 at 17:32
  • $\begingroup$ No, using parsecs is a good idea. The distance of most stars compared to the Sun's radius is very lage. $\endgroup$
    – user21
    Commented Apr 1, 2020 at 15:48

1 Answer 1


No. This calculation is a rough approximation. It's probably good enough for any amateur use, but a more precise calculation would be using 1/tan(parallax). Continue using parsecs for distance, but if you decide to convert to light-years, it's simple math (lightyears = parsecs * 3.26156).

This is just me, thinking out loud here, but the way I did it was to use the Right Ascension and Declination to convert to Cartesian coordinates (with Earth as the 0,0,0). It looks like you're using the same formulas (subbing in b and l for RA and Dec), so if you wanted to switch, it wouldn't be hard, but it might be more accurate.

Some other things to consider: the reference epoch is important. It's basically the date of the measurements that you're using, so if the reference epoch is 1950, you'd need to add the proper motion to whichever coordinate system you're using to bring it in line with where things are today (e.g. ref epoch of 1950 needs to add the proper motion [right ascension] and the proper motion [declination] 71 times before you convert to cartesian coordinates). Additionally, you might have to add the travel time of the light to get really, really accurate results (e.g. Neptune is 249.98 according to Quora [not the best of sources, but good for illustration], so you'd have to add 249.98 minutes' worth of right ascension and proper motion before converting to cartesian coordinates).

TL;DR: start with RA, Dec and ref epoch. For RA and Dec, multiply the proper motion by the sum of (the difference between ref epoch and date of interest) and 1/(3652460) * distance in light minutes. Then, use 1 / tangent (parallax [in arcseconds]) and plug in those values into the formulas you already have.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .