<p>I'm trying to model the orbits of Earth and Mars and their positions at a given point in time. But I can only find 2D equations of elliptic orbits, which only contain the x and y variables. I have to find formulae or equations for the two orbits that also contain the z variable.</p>
<p>Thank you!</p>

CC BY-SA 4.0
2021-08-06T00:53:22.593Z
A pure Kepler ellipse is planar. The [orbital elements](https://en.wikipedia.org/wiki/Orbital_elements) include info about the 3D orientation of an orbit. You can use matrices to transform coordinates. The diagrams in my answer here might be helpful. https://astronomy.stackexchange.com/a/43350/16685
PM 2Ring
CC BY-SA 4.0
2021-08-06T10:50:42.650Z
*Welcome to Stack Exchange!* Modeling orbits is a lot of fun! What are you using to calculate? Pen + paper? Excel? A computer? In addition to using equations for motion in Kepler orbits, you can also do some simple numerical simulations. If you can add some more to your question post about what kinds of calculations you like to do, it will be easier to write an answer that you'll find helpful/useful.
uhoh
CC BY-SA 4.0
2021-08-06T11:05:53.297Z
Additionally this practical approach may help.
https://www.mathworks.com/matlabcentral/answers/317153-how-draw-an-ellipse-by-acquiring-points-in-3d
Exactly, depends on the used tool. Still the more theory posted above might come an easy way to a solution.
Lariliss
CC BY-SA 4.0
2021-08-11T11:47:12.980Z
Hi @uhoh! I'm using pen&paper + graphic calculator + Mathematica online.
LIdbioe
<orbit><solar-system><astrophysics><mathematics>
Is there a formula for a planet's orbit in a 3D space?
LIdbioe
# Is there a formula for a planet's orbit in a 3D space?

(Asked by: username_0 on 2021-08-06)

I'm trying to model the orbits of Earth and Mars and their positions at a given point in time. But I can only find 2D equations of elliptic orbits, which only contain the x and y variables. I have to find formulae or equations for the two orbits that also contain the z variable.

Thank you!

**Tags:** orbit, solar-system, astrophysics, mathematics
> **Comments:**
> **username_1**: A pure Kepler ellipse is planar. The [orbital elements](https://en.wikipedia.org/wiki/Orbital_elements) include info about the 3D orientation of an orbit. You can use matrices to transform coordinates. The diagrams in my answer here might be helpful. https://astronomy.stackexchange.com/a/43350/16685  
> **username_2**: *Welcome to Stack Exchange!* Modeling orbits is a lot of fun! What are you using to calculate? Pen + paper? Excel? A computer? In addition to using equations for motion in Kepler orbits, you can also do some simple numerical simulations. If you can add some more to your question post about what kinds of calculations you like to do, it will be easier to write an answer that you'll find helpful/useful.  
> **username_3**: Additionally this practical approach may help. https://www.mathworks.com/matlabcentral/answers/317153-how-draw-an-ellipse-by-acquiring-points-in-3d Exactly, depends on the used tool. Still the more theory posted above might come an easy way to a solution.  
> **username_0**: Hi @uhoh! I'm using pen&paper + graphic calculator + Mathematica online.  

---

## 0 answers

