Well given the 6 common Kepler orbital elements:
- Eccentricity $e$
- Semimajor axis $a$
- inclination $i$
- Longitude of ascending node $\Omega$
- Argument of periapsis $\omega$
- True anomaly $\nu$
As can be seen in this image:
![]()
I am wondering how to calculate the actual position and speed vector ($\mathbf{r}, \mathbf{v}$)
Doing the inverse is quite straight forward (using wikipedia):
$$\mathbf{h} = \mathbf{r} \times \mathbf{v}$$ $$\mathbf{\hat{n}} = \mathbf{\hat{k}} \times \mathbf{v}$$ $$E = \frac{V^2}{2} - \frac{\mu}{|\mathbf{r}|}$$ $$\mathbf{e} = \left( \frac{v^2}{\mu} - \frac{1}{|\mathbf{r}|}\right)\mathbf{r} -\frac{ \mathbf{r} \cdot \mathbf{v}}{\mu} \mathbf{v}$$ $$a = -\frac{\mu}{2E}$$ $$\cos i = \frac{h_k}{|\mathbf{h}|}$$ $$\cos \Omega = \frac{n_i}{|\mathbf{n}|}$$ $$\cos \omega = \frac{\mathbf{n} \cdot \mathbf{e}}{|\mathbf{n}||\mathbf{e}|}$$ $$\cos \nu = \frac{\mathbf{e} \cdot \mathbf{r}}{|\mathbf{e}||\mathbf{r}|}$$
\hr
However how can I calculate the inverse of this? How can I calculate the position given all orbital elements?
You can use the fact that the in plane of the orbit you can write:
$$\boldsymbol{r_{plane}} = \frac{(1+e)q}{1+e\cos{\nu}}(\cos{\nu}, \sin{\nu}, 0)$$
$$ \boldsymbol{v_{plane}} = \sqrt{\frac{\mu}{q(1+e)}}(-\sin{\nu}, e + \cos{\nu}, 0)$$
where $q$, $e$ $\nu$, and $\mu = m_1 m_2 / (m_1 + m_2)$ state for the periapsis, eccentricity, true anomaly, and reduced mass
Then, you can use the Euler angles to get the corresponding state vector as follows:
$$ \mathbf{ (r_{sky},v_{sky}) } = R_{z}(\omega)R_{x}(i)R_{z}(\Omega) \mathbf{ (r_{plane},v_{plane}) } $$
The image in the question should help to clarify the equations above.