Last edited 10may03 by Matt Townsend
Back to main project

Calculating Orbits


To calculate the orbit of any body we must first identify the key orbital elements. The first four elements have already been explained or are trivial and easy to understand, but the second four may require some explanation:

Longitude of the Ascending Node: This is the angle between the line of nodes and the zero point of longitude in the reference plane, labeled in the diagram as W.

Inclination to the Ecliptic: This is the angle between the orbital plane and the equatorial or reference plane. Our solar system is shaped like a disc, so the planets for the most part orbit on the same reference plane, known as the ecliptic, but they do have slight deviations.

Argument of Perihelion: Labeled w in the diagram, this is the angle between the ascending node and the planet's location at perihelion.

Mean Anomaly: This element is defined as the product of the mean motion and the time since perigee. The Mean motion is the average angular velocity required to complete one revolution on an orbit in the period of the orbit.

With these definitions, we can now identify our key orbital elements:

e - eccentricity of orbit
a - semi-major axis (AU)
y - length of year (days)
d - day of year
N - longitude of the ascending node
i - inclination to the ecliptic
w - argument of perihelion
m - mean anomaly

Using these orbital elements, several others must be calculated before the nature of the orbit can be identified:

w1 = N + w       // longitude of perihelion
L = M + w1       // mean longitude
q = a * (1-e)       // perihelion distance
Q = a * (1+e)       // aphelion distance

      // period - according to Kepler's Law


      // eccentric anomaly

Using the eccentric anomaly, we can calculate the true anomaly of the orbit. This takes several steps :

if xv > 0, v = arctan (yv / xv)
if xv < 0, v = arctan (yv / xv) + π
if yv < 0, v = -90
if yv > 0, v = 90

Finally, we can calculate the average radius of the orbit:

Using all of the above values, we can draw a 3-dimensional orbit by calculating x, y, and z according to the following formulas :

x = r * ( cos (N) * cos (v+w) - sin (N) * sin (v+w) * cos (i) )
y = r * ( sin (N) * cos (v+w) + cos (N) * sin (v+w) * cos (i) )
z = r * ( sin (v+w) * sin (i) )

Back to main project