Tools › Orbital Mechanics › Orbits and Elements › Orbital Elements and State Vectors › Method

Orbital Elements and State Vectors: Method

Open the Orbital Elements and State Vectors tool

The Six Elements, Kepler's Equation, What It Assumes, Common Mistakes

What the tool does

It translates between the two usual ways of describing an orbit: six classical (Keplerian) elements, which say what the orbit looks like, and a position and velocity vector, which say where the spacecraft is and how it is moving at one instant. From either one, or from a pasted two-line element set, it gives the other, the period, the lowest and highest points with their speeds, the energy and angular momentum, a drawing of the orbit to scale and, in Advanced mode, the position at a later time, the slow drift caused by the planet's bulge and the ground track.

The idea

A spacecraft coasting near one large body follows a conic section with the body at one focus: a circle, an ellipse, a parabola or a hyperbola. Six numbers pin the motion down completely. A position and a velocity are six numbers (three components each), but they change every second. The classical elements are six numbers chosen so that five of them stay fixed and only one moves (Figure 1):

Left: an ellipse with the body at one focus, showing the semi-major axis a, the distance a e from the center to the focus, the periapsis and apoapsis radius, the semi-latus rectum p, the radius r to the spacecraft at true anomaly nu, and the eccentric anomaly E measured at the center on a circle of radius a. Right: the orbit plane tilted against the equator plane by the inclination i, with the node angle Omega measured in the equator plane from the x axis to the ascending node, the argument of periapsis omega from the node to the periapsis and the true anomaly nu from the periapsis to the spacecraft
Figure 1: The elements that give the size and shape of the orbit and the place on it (left), and the three angles that orient it in space (right)
  • Size: semi-major axis a. Half the long axis of the ellipse. It alone sets the period and the energy.
  • Shape: eccentricity e. 0 is a circle, between 0 and 1 an ellipse, exactly 1 a parabola, above 1 a hyperbola.
  • Tilt: inclination i. The angle between the orbit plane and the equator plane of the body. Above 90° the spacecraft goes round against the body's spin.
  • Swivel: right ascension of the ascending node Ω. The angle in the equator plane from a fixed reference direction (x) to the point where the spacecraft crosses the equator going north.
  • Turn within the plane: argument of periapsis ω. The angle in the orbit plane from that node to the lowest point of the orbit.
  • Place on the orbit: true anomaly ν. The angle from the lowest point to the spacecraft, seen from the body. This is the one that moves.

The tool writes as for the semi-major axis, ecc for the eccentricity and inc for the inclination, because its equation engine cannot use the bare letters a, e and i; this page uses the usual letters.

The equations

μ is the gravitational parameter of the body (its mass times the gravitational constant), Rb its equatorial radius, r the distance of the spacecraft from the center and v its speed.

Size and shape. Periapsis and apoapsis radius, semi-latus rectum and the equation of the orbit:

rp = a (1 − e),   ra = a (1 + e),   a = (rp + ra) / 2,   e = (ra − rp) / (ra + rp)
p = a (1 − e2) = h2 / μ,   r = p / (1 + e cos ν)

An altitude is a radius minus Rb. For a hyperbola a is negative, so that the same formulas hold; a parabola has no a, and the tool works from p.

Period, speed, energy, angular momentum.

T = 2π √(a3 / μ)   (Kepler's third law)
v = √[μ (2 / r − 1 / a)]   (the vis-viva equation; 1 / a = 0 for a parabola)
ε = v2 / 2 − μ / r = −μ / (2 a),   h = rp vp = √(μ p)
tan γ = e sin ν / (1 + e cos ν)   (flight-path angle γ, above the local horizon)

For a hyperbola the speed far from the body is v∞ = √(−μ / a), the path turns through δ = 2 asin(1 / e) and the true anomaly stays inside ±acos(−1 / e).

From elements to vectors. In the orbit plane, with xw toward the periapsis and yw a quarter turn ahead (the perifocal frame):

xw = r cos ν,   yw = r sin ν,   vxw = −(μ / h) sin ν,   vyw = (μ / h) (e + cos ν)

Three rotations (by ω about the normal of the plane, by i about the line of nodes, by Ω about the z axis) carry these into the inertial frame. Multiplied out, the position is

rx = (cos Ω cos ω − sin Ω sin ω cos i) xw + (−cos Ω sin ω − sin Ω cos ω cos i) yw
ry = (sin Ω cos ω + cos Ω sin ω cos i) xw + (−sin Ω sin ω + cos Ω cos ω cos i) yw
rz = (sin ω sin i) xw + (cos ω sin i) yw

and the velocity is the same combination of vxw and vyw. These are equations (4a) to (4f) of NASA Reference Publication 1009; as printed there, (4e) has a cosine where a sine belongs and (4f) a misplaced parenthesis, which the tool's test script documents.

From vectors to elements. Three vectors do the work: the angular momentum h = r × v (perpendicular to the orbit plane), the node vector n = (−hy, hx, 0) (pointing to the ascending node) and the eccentricity vector, which points to the periapsis and whose length is e:

e = [(v2 − μ / r) r − (r · v) v] / μ
cos i = hz / h
cos Ω = nx / n   (Ω = 360° − that when ny is negative)
cos ω = n · e / (n e)   (ω = 360° − that when ez is negative)
cos ν = e · r / (e r)   (ν = 360° − that when r · v is negative: the spacecraft is on its way down)

When an element has no meaning. A circle has no periapsis, and an equatorial orbit has no node. The tool then uses these conventions and says so in the results: circular and inclined, ω = 0 and ν counted from the ascending node; equatorial and not circular, Ω = 0 and ω counted from the x axis to the periapsis in the direction of motion; circular and equatorial, Ω = ω = 0 and ν counted from the x axis. An orbit counts as circular below an eccentricity of 10−8 and as equatorial when the sine of its inclination is below 10−8. A velocity that points straight along the position vector gives a straight line through the body, which has no elements; the tool refuses it in words.

Position and time: Kepler's equation. The true anomaly does not grow evenly with time: the spacecraft is fast when low and slow when high. Two helper angles connect the two. The eccentric anomaly E is measured at the center of the ellipse on a circle drawn around it (Figure 1, left). The mean anomaly M is the fraction of the period gone by since periapsis, written as an angle, so it grows at the steady rate n = √(μ / a3):

tan(E / 2) = √[(1 − e) / (1 + e)] tan(ν / 2),   M = E − e sin E   (angles in radians),   t = M / n

Going from ν to time is direct. Going from time to ν means solving M = E − e sin E for E, which has no closed solution. The tool uses Newton's method,

Ek+1 = Ek − (Ek − e sin Ek − M) / (1 − e cos Ek)

starting from E0 = M + e sin M, or from E0 = π when e is 0.8 or more (from π the method converges for every ellipse). It stops when a step changes E by less than 10−13 rad, shows the first step in full and tabulates the rest. For a hyperbola the same job is done by M = e sinh F − F with tanh(F / 2) = √[(e − 1) / (e + 1)] tan(ν / 2) and n = √(μ / (−a)3); for a parabola by Barker's equation, t = ½ √(p3 / μ) (D + D3 / 3) with D = tan(ν / 2), a cubic with one real root.

A later position. In two-body motion the five fixed elements stay fixed. The tool advances the mean anomaly by n Δt, solves Kepler's equation again and builds the new vectors from the new true anomaly.

Drift from the planet's bulge (J2). A spinning planet bulges at its equator. Averaged over many revolutions the bulge turns the orbit plane about the spin axis and turns the ellipse in its plane at the rates (equations (5a) and (5b) of NASA Reference Publication 1009, here with the plain two-body mean motion n)

dΩ/dt = −(3/2) J2 n (Rb / p)2 cos i,   dω/dt = (3/4) J2 n (Rb / p)2 (5 cos2 i − 1)

An orbit whose node drifts east by 360° a year (0.9856° a day at Earth) keeps the same angle to the Sun all year: it is sun-synchronous, which needs an inclination a little above 90°. At i = 63.4° the second rate is zero, so the high point of a stretched orbit stays over the same latitude: the Molniya orbit.

Ground track. For each instant the latitude and the inertial angle of the spacecraft follow from u = ω + ν:

sin(latitude) = sin i sin u,   longitude = Ω + atan2(cos i sin u, cos u) − θ0 − (2π / Trot) t

where Trot is the rotation period of the body and θ0 the angle of its prime meridian from the x axis at the start.

Two-line element sets. Tracking services publish Earth satellites as two 69-character lines. Line 2 holds the inclination, node angle, eccentricity (decimal point left out), argument of perigee, mean anomaly and mean motion in revolutions per day; line 1 holds the epoch as a year and a day of the year with fraction; the last digit of each line is a check digit (digits added up, each minus sign counting 1, last digit of the sum). The semi-major axis is not printed: the tool gets it from the mean motion, a = (μ / n2)1/3.

What it assumes

  • One body, treated as a point mass: no drag, no pull of the Moon, the Sun or other planets, no pressure of sunlight, no thrust.
  • The inertial frame has its x and y axes in the equator plane of the body and z along its spin axis. The mathematics works in any non-rotating frame (the 'Oumuamua case uses the frame of the JPL Horizons output, which is tied to Earth's equator), but the J2 rates and the ground track are right only when the reference plane is the body's own equator.
  • The J2 rates are first-order averages for closed orbits; they are reported, not applied to the positions.
  • The ground track is geocentric (the angle at the center of the body), over a body turning at a steady rate, with no drift of the node.
  • Body constants: gravitational parameters of the JPL planetary ephemeris DE440; equatorial radii, J2 and sidereal rotation periods of the NASA planetary fact sheets, shared with Orbital and Rocket Delta-v.

When it misleads

  • Two-line element sets. Their numbers are averaged (mean) elements built for the SGP4 model, which adds back the wobbles the averaging removed. Used directly, as here, they give the size, shape and plane of the orbit to within kilometers and about a tenth of a degree but only a rough position along the orbit, off by kilometers even at the epoch and by far more a day later. The report that defines these element sets says plainly that they must be used with its own models. Never use this tool to find where a satellite is in the sky.
  • Low orbits over days. For a satellite at 400 km the node moves about 5° a day and drag changes the period: a two-body position a few revolutions ahead is already wrong by more than the size of a city.
  • Nearly circular or nearly equatorial orbits. The argument of periapsis and the true anomaly of a nearly circular orbit, or the node of a nearly equatorial one, swing wildly with tiny changes in the vectors, though their sum hardly moves. The position is fine; the individual angles are not meaningful.
  • Osculating against mean elements. Elements computed from a real position and velocity (as JPL Horizons gives) describe the orbit that fits that instant; they wobble through each revolution. They need not match a mean element set of the same satellite.
  • Far from the body. A hyperbola about a planet is only good inside the planet's sphere of influence; beyond it the Sun takes over.

Common mistakes

  • Altitude for radius. Every orbital formula uses the distance from the center of the body. Forgetting to add the body's radius (6,378 km for Earth) to an altitude is the most common error.
  • Degrees in Kepler's equation. In M = E − e sin E the angles outside the sine must be in radians.
  • The wrong half of the orbit. An arccosine returns an angle between 0° and 180°; Ω, ω and ν can each be anywhere up to 360°. Each needs its sign test (ny, ez, r · v). Likewise the half-angle formula between ν and E keeps the two in the same half of the orbit.
  • Mixing mean, eccentric and true anomaly. They are equal only for a circle. For e = 0.72 a mean anomaly of 31° is a true anomaly of 120°.
  • Mixed units. μ in km³/s² goes with km and km/s. With meters it is 109 times larger.
  • Semi-major axis of a hyperbola. It is negative; with a positive value the vis-viva equation gives a speed that is too low.
  • Period from the wrong day. A geostationary satellite goes round once per sidereal day (23 h 56 min), the time Earth takes to turn once against the stars, not once per 24 hours.
  • Reading a two-line element set by splitting at spaces. The fields sit in fixed columns and some hold spaces; the eccentricity has no decimal point.

For changing from one orbit to another (Hohmann and bi-elliptic transfers, plane changes, rocket staging) see Orbital and Rocket Delta-v.