English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Assuming the sun is at the center (0,0) and the earth's orbit stays in the xy-plane.
It should be an ellipse that speeds up the closer it is to the sun (which will be one focus of the ellipse).

2007-05-22 11:59:22 · 2 answers · asked by Lobster 4 in Science & Mathematics Mathematics

s: I'm trying to program a simulation of the earth orbiting the sun. I can approximate it from hour to hour or so by constantly recalculating the velocity vector using Newton's Law of Gravitation but it seems like there should be a simpler formula to get the coordinates.

2007-05-22 12:22:18 · update #1

2 answers

There isn't a simple formula as a function of time. If you look up thr Kepler problem in a classical mechanics book, you can find some equations that will help you. It requires the solution of the 'Kepler Equation'

wt=A-esin(A)

where w^2=GM/a^3.

Then r=a(1-e cos(A)) and

tan(theta/2)=sqrt[(1+e)/(1-e)] tan(A/2).

Here, 'a' is the semi-major axis of the ellipse, eis the eccentricity, 'r' and 'theta' are the polar radius and angle, 't' is the time and 'A' is called the eccentric anomaly.

Then,
x=r cos(theta) and
y=r sin(theta).

2007-05-22 13:20:25 · answer #1 · answered by mathematician 7 · 0 0

What are you doing this for? For a first approximation just go with

x=(AU)cos(t/(365days/360deg))

y=(AU)sin(t/(365days/360deg))

Where AU is the sun earth distance. The orbit of the earth around the sun is near circular.

Hmm, what the guy says below is true, it's no joke to find the theta(t) that would go in below. If you're doing this iteratively, Newton's laws are as good as anything. You can always use that rxv=constant to help out in a pinch.

2007-05-22 19:05:13 · answer #2 · answered by supastremph 6 · 2 0

fedest.com, questions and answers