- #1
Jman2150
- 2
- 0
Forgive me if this is in the wrong thread I'm new here.
I am trying to plot an orbit in MatLab using Kepler's First law of motion. In polar form it works fine r(θ) = h^2/μ*(1/(1+e*cos(θ)))
h = angular momentum μ = standard gravitational constant and e = eccentricity.
The problem is I'd like to have everything in Cartesian coordinates and I can't seem to get the conversion correct.
I thought it would just be the equation for an ellipse (x/a)^2+(y/b)^2=1 but that doesn't give me the right shape for some reason.
So if someone knows the direct conversion of Kepler's first law from polar to Cartesian coordinates I would very much appreciate the help.
I am trying to plot an orbit in MatLab using Kepler's First law of motion. In polar form it works fine r(θ) = h^2/μ*(1/(1+e*cos(θ)))
h = angular momentum μ = standard gravitational constant and e = eccentricity.
The problem is I'd like to have everything in Cartesian coordinates and I can't seem to get the conversion correct.
I thought it would just be the equation for an ellipse (x/a)^2+(y/b)^2=1 but that doesn't give me the right shape for some reason.
So if someone knows the direct conversion of Kepler's first law from polar to Cartesian coordinates I would very much appreciate the help.