<p>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).</p>
<p>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.</p>
<p>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 <em>before</em> you convert to cartesian coordinates).  Additionally, you <em>might</em> 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).</p>
<p>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/(365<em>24</em>60) * distance in light minutes.  Then, use 1 / tangent (parallax [in arcseconds]) and plug in those values into the formulas you already have.</p>

CC BY-SA 4.0
2021-12-11T23:28:11.687Z
2021-12-11T23:28:11.687Z
GrasshopperTaji
<p>Lets say I have galactic coordinates of an object, l and b.</p>

<p>I figured out that i can transform them to cartesian system using the formula:</p>

<p><span class="math-container">$$
\begin{align}
X &amp;= \cos(b)\cos(l)\\
Y &amp;= \cos(b)\sin(l)\\
Z &amp;= \sin(b)
\end{align}
$$</span></p>

<p>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.</p>

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

CC BY-SA 4.0
2020-03-21T01:18:10.457Z
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
planetmaker
CC BY-SA 4.0
2020-03-21T10:41:15.407Z
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.
JackJohn
CC BY-SA 4.0
2020-03-21T17:32:01.320Z
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?
JackJohn
CC BY-SA 4.0
2020-04-02T13:09:04.537Z
alright, thank you very much
JackJohn
<coordinate>
Transforming Galactic Coordinates in Cartesian with Distance
JackJohn
# Transforming Galactic Coordinates in Cartesian with Distance

(Asked by: username_0 on 2020-03-20)

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!

**Tags:** coordinate

> **Comments:**
> **username_1**: 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  
> **username_0**: 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.  
> **username_0**: 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?  
> **username_0**: alright, thank you very much  

---

## 1 answers

### Answer by username_2 on 2021-12-11. Score: -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/(365*24*60) \* distance in light minutes. Then, use 1 / tangent (parallax [in arcseconds]) and plug in those values into the formulas you already have.


---

