Kepler's First law Polar to Cartesian

Click For Summary

Discussion Overview

The discussion revolves around converting Kepler's First Law from polar to Cartesian coordinates for plotting orbits in MatLab. Participants explore the mathematical relationships involved in this conversion, addressing issues related to the shape of the plotted orbit and the correct formulation of the equations.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Exploratory

Main Points Raised

  • One participant shares the polar form of Kepler's First Law and expresses difficulty in converting it to Cartesian coordinates.
  • Another participant questions what is meant by "doesn't give me the right shape" and suggests that the issue may stem from needing to plot both positive and negative square roots when solving for y.
  • A different participant notes that the polar equation represents an ellipse with one focus at the origin, while the Cartesian equation assumes the ellipse is centered at the origin, which could lead to discrepancies.
  • One participant explains that the conversion from polar to Cartesian coordinates involves using the relationships x = rcosθ and r = √(x² + y²), suggesting that rearranging these can yield the correct equation for the ellipse.
  • A later reply confirms that the issue was due to the Cartesian ellipse being centered at the origin, and after making the necessary correction, the plotting worked as intended.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the initial confusion regarding the shape of the plotted orbit, but there is agreement on the importance of correctly identifying the center of the ellipse in Cartesian coordinates.

Contextual Notes

The discussion highlights potential limitations in understanding the relationship between polar and Cartesian forms of the ellipse, particularly regarding the positioning of the ellipse's center and the implications for plotting.

Jman2150
Messages
2
Reaction score
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.
 
Science news on Phys.org
Jman2150 said:
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.

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.
 
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 thatr \propto \frac{1}{1 + ex/r}I find that if you just rearrange to solve for r, and then plug in r = \sqrt{x^2 + y^2} which is also always true, you get an equation for the same ellipse, with the correct shift relative to the origin.
 
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.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 23 ·
Replies
23
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 7 ·
Replies
7
Views
4K