Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Kepler's First law Polar to Cartesian

  1. Mar 11, 2012 #1
    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.
     
  2. jcsd
  3. Mar 11, 2012 #2

    cepheid

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    What exactly do you mean by "doesn't give me the right shape?" What does it end up looking like?

    There are a couple of things that could be a problem here. If you solve your cartesian equation for y so that you can plot it vs. x, you are going to get a square root. You need to separately plot both the positive and negative square roots in order to get both halves of the ellipse.

    Another problem could be that the equation of the ellipse in polar form that you have is for an ellipse for which one focus is at the origin. In contrast, the equation for the ellipse in Cartesian coordinates that you have is for an ellipse whose centre is at the origin. I'm not sure if this shift is causing you difficulties.
     
  4. Mar 12, 2012 #3

    cepheid

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Another thing is that it is a really straightforward conversion from your equation in polar form to one in Cartesian form. It's always true that x = rcosθ. Or cosθ = x/r So, you have that[tex] r \propto \frac{1}{1 + ex/r}[/tex]I find that if you just rearrange to solve for r, and then plug in [tex] r = \sqrt{x^2 + y^2}[/tex] which is also always true, you get an equation for the same ellipse, with the correct shift relative to the origin.
     
  5. Mar 12, 2012 #4
    Cepheid,

    Thanks man. Turns out that it was because my Cartesian ellipse was centered at the origin. I made the correction and it works fine now.

    Appreciate the help.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Kepler's First law Polar to Cartesian
  1. Kepler's 3rd Law (Replies: 14)

  2. Kepler's 3rd law (Replies: 5)

Loading...