Safeguard
Supply Chain Security•

Kepler's Laws Explained With Worked Examples, Planets to Satellites

Kepler's three laws: elliptical orbits, equal areas in equal times, and T² ∝ a³. Worked examples for Mars, geostationary, 550 km, GPS and TLE data.

Safeguard Security Team
48 min read

Kepler's three laws say that planets move on ellipses with the Sun at one focus, that the Sun to planet line sweeps out equal areas in equal times, and that the orbital period squared is proportional to the semi-major axis cubed. Kepler published the first two in 1609 and the third in 1619. With Newton's gravity behind them, they still size satellite orbits today.

This post goes one level below our tour of famous equations that changed the world. It pairs with the laws of gravity from Newton to Einstein, which explains the force that makes Kepler's laws true, and with Newton's three laws of motion, which supply the other half of the derivation. The satellite examples connect to how satellite internet works and to the evolution of GPS and GNSS. Here we work the numbers.

A note on numbers. Planetary data come from NASA's planetary fact sheets, gravitational parameters, the astronomical unit, the sidereal day and mean orbital elements from NASA JPL's Solar System Dynamics group, G from NIST's 2022 CODATA tables, GPS figures from GPS.gov, the element set format from CelesTrak, and the history from the MacTutor archive at the University of St Andrews and NASA Science. Orbits we chose ourselves are labelled illustrative. Every number was recomputed with the Python script in the walkthrough.

Key takeaways

  • First law: each planet's orbit is an ellipse with the Sun's centre at one focus, so the Sun to planet distance changes all the way round. Satellites around Earth follow the same rule with Earth's centre at the focus.
  • Second law: the line from the Sun to a planet sweeps out equal areas in equal times. A body moves fastest at its closest point (perihelion, or perigee for an Earth satellite) and slowest at its farthest. It is conservation of angular momentum in geometric dress.
  • Third law: T² is proportional to a³. In years and astronomical units, for bodies orbiting the Sun, T² = a³. Newton's version, T² = 4π²a³ / (G(M + m)), works for any two bodies, including satellites around Earth.
  • Worked results: Mars at 1.5237 au takes about 687 days. Geostationary orbit sits 35,786 km above the equator. A 550 km orbit takes about 95.6 minutes. Half a sidereal day puts GPS about 20,200 km up, matching GPS.gov. The ISS's element set implies a mean altitude of about 420 km.
  • Orbital elements: six numbers (semi-major axis, eccentricity, inclination, right ascension of the ascending node, argument of perigee and mean anomaly at an epoch) pin down a Kepler orbit. Two line element sets carry them for tracked satellites, in a punch card era format that ran out of five digit catalogue numbers on 11 July 2026, according to CelesTrak.
  • Limits: Kepler's laws describe two bodies and nothing else. Other planets, Earth's equatorial bulge, atmospheric drag, sunlight pressure and general relativity all bend real orbits away from a fixed ellipse, which is why satellite elements go stale within days.

What are Kepler's three laws?

NASA Science states the three laws in plain terms. Each planet's orbit about the Sun is an ellipse, with the Sun's centre at one focus. The imaginary line joining a planet and the Sun sweeps out equal areas during equal time intervals. And the orbital period squared is directly proportional to the semi-major axis cubed, which NASA writes as p² = a³ when the period is in years and the distance in astronomical units.

The first law: orbits are ellipses with the Sun at one focus

An ellipse is the set of points whose distances to two fixed points, the foci, add up to the same constant. Its flattening is the eccentricity e, from 0 for a circle towards 1 for a long, thin ellipse, and half its longest axis is the semi-major axis a, the length that matters for the third law.

Three numbers fall straight out of a and e:

perihelion distance   r_p = a(1 − e)
aphelion distance     r_a = a(1 + e)
semi-major axis       a   = (r_p + r_a) / 2
eccentricity          e   = (r_a − r_p) / (r_a + r_p)

OpenStax defines the semi-major axis the same way, and notes that for the Moon (and any Earth satellite) the closest and farthest points are called perigee and apogee.

Check it against Mars. NASA's Mars fact sheet gives perihelion 206.650 million km and aphelion 249.261 million km. Half their sum is 227.956 million km, which is exactly the semi-major axis on the same sheet. The eccentricity formula gives (249.261 − 206.650) / (249.261 + 206.650) = 0.0935, which again matches the sheet's 0.0935. Earth's orbit is rounder: perihelion 147.095 million km, aphelion 152.100 million km, eccentricity 0.0167.

The important detail is the focus. The Sun sits offset from the centre by a × e, about 21.3 million km for Mars. The ellipse itself is barely flattened, but the off centre Sun makes Mars's distance swing by more than 42 million km over a Martian year.

The second law: equal areas in equal times

The second law is about speed. In any fixed interval, say one week, the Sun to planet line sweeps out a wedge of area, and every one week wedge has the same area. Near perihelion the line is short, so the wedge must be wide; near aphelion a narrow wedge is enough. NASA puts it directly: a planet moves fastest at perihelion and slowest at aphelion. At either end of the major axis the area swept per unit time is ½ × r × v, so:

r_p × v_p = r_a × v_a      so      v_p / v_a = r_a / r_p

The third law: T² is proportional to a³

The third law ties the size of an orbit to how long it takes. In NASA's form, with T in years and a in astronomical units, T² = a³ for anything orbiting the Sun. Double the semi-major axis and the period grows by a factor of 2^1.5, about 2.83. NASA's illustration uses Mercury at 88 days, Earth at 365 days and Saturn at about 10,759 days (Saturn's own fact sheet gives a sidereal period of 10,755.699 days).

The third law does the engineering work: choose a period and it hands you an altitude, and the reverse. It also hands you a mass, which is why NASA calls Newton's generalised version the basis of most mass measurements of distant objects.

When were Kepler's laws published?

YearEventSource
1571Johannes Kepler born, 27 December, in Weil der StadtMacTutor; NASA Science
Late 1570s onwardThe King of Denmark gives Tycho Brahe the island of Hven; about twenty years of observations follow at UraniborgMacTutor (Brahe)
1596Kepler publishes Mysterium Cosmographicum and sends a copy to TychoMacTutor (Kepler)
1599 to 1600Tycho becomes Imperial Mathematician in Prague (1599); Kepler, banished from Graz on 2 August 1600, joins him and is set to work on MarsMacTutor (Brahe); NASA Science
1601Tycho dies; Kepler succeeds him as Imperial MathematicianMacTutor (Kepler)
About 1605The Mars work is essentially complete; publication is delayedMacTutor (Kepler)
1609Astronomia Nova (Heidelberg) publishes the first and second lawsMacTutor; NASA Science
1619Harmonices Mundi (Linz) publishes the third law, found while the book was in pressMacTutor; NASA Science
1627Rudolphine Tables (Ulm), built on Tycho's data and Kepler's first two lawsMacTutor (Kepler)
1630Kepler dies, 15 November, in RegensburgMacTutor; NASA Science
1684Halley asks Newton what orbit an inverse square force producesMacTutor (Newton)
1687Newton publishes the Principia, deriving the orbits from universal gravitationMacTutor (Newton)
2012The IAU redefines the astronomical unit as exactly 149,597,870,700 m (Resolution B2)IAU; JPL

One note on the table: MacTutor's Kepler biography gives the Rudolphine Tables as Ulm, 1627 in one place and Ulm, 1628 in another. MacTutor also notes that Tycho's major instruments were mostly completed in the mid 1580s.

The order of discovery is worth noticing. According to MacTutor, Kepler found the area law and the ellipse in the course of the Mars work, and NASA notes that the area law came first and led to the ellipse. The third law came last and, in Kepler's own account quoted by MacTutor, was not discovered until Harmonices Mundi was already being printed.

How did Tycho Brahe's observations make the laws possible?

Kepler's laws are an inference from data, and the data were Tycho Brahe's. MacTutor describes Tycho's observatory at Uraniborg, funded by the King of Denmark, as "equipped with exceptionally large and accurate instruments", and credits him with twenty years of observations there. A careful modern study of his instruments, summarised in a review MacTutor quotes, found that most of his observational errors fell between about 0.5 and 1.0 minutes of arc, which is roughly the accuracy of a naked eye instrument pushed to its limit, decades before the telescope.

That accuracy mattered because the Mars data would not fit any model built from circles. Kepler, in MacTutor's account, had so many observations that once he constructed a possible orbit he could test it against further observations until it agreed. Circular models came close, but not within the accuracy of Tycho's data, so the circle had to go.

NASA's orbits page adds an irony. Tycho gave Kepler the Mars problem partly, historians think, to keep him busy while Tycho developed his own geocentric hybrid model. Mars turned out to have the most elliptical orbit of the planets Tycho had extensive data for, so the assignment handed Kepler exactly the data most likely to reveal an ellipse.

The work was enormous. MacTutor notes that nearly a thousand folio sheets of Kepler's Mars arithmetic survive, and that Kepler called the effort his war with Mars. It was done before logarithms reached him: according to the same biography, he came across Napier's logarithms in 1616, after the first two laws were already published.

The lesson is durable: a model that fits coarse data can be wrong in a way only better measurement reveals. The same instinct drives every modern orbit determination system that fits element sets to tracking data.

How did Newton derive Kepler's laws from gravity?

Kepler described how planets move but had no physical cause that worked. Newton supplied one. MacTutor's account is precise about the order. After his 1679 correspondence with Robert Hooke, Newton found a proof that Kepler's area law follows from any centripetal force, and showed that if an orbit is an ellipse under a central force, the force must vary as the inverse square of distance. In 1684 Edmond Halley asked him what orbit an inverse square force would produce; Newton answered that it would be an ellipse. Halley persuaded him to write the full treatment, and the Principia appeared in 1687.

The second law from angular momentum

Gravity pulls along the line between the two bodies. A force along that line exerts no torque about the Sun, so the planet's angular momentum about the Sun stays constant. The rate at which the Sun to planet line sweeps out area is exactly the angular momentum per unit mass divided by two:

dA/dt = L / (2m) = constant

That is the second law, and it holds for any central force, not just gravity. OpenStax makes the same point in its treatment, deriving the area law from conservation of angular momentum. The practical meaning is that the second law would survive even if gravity were not inverse square; the first and third laws would not.

The first law from the inverse square law

OpenStax states the result: when Newton's law of universal gravitation is combined with his second law of motion, the path of any satellite is a conic section. A bound orbit with negative total energy is a circle or an ellipse; an unbound one is a parabola or hyperbola. Which shape you get depends on the total energy and angular momentum.

OpenStax adds a refinement Kepler could not have known. Both bodies move. Each traces the same shaped conic around their common centre of mass, which sits at the focus. Using JPL's GM values, the Sun and Jupiter's centre of mass lies about 742,600 km from the Sun's centre, just beyond the Sun's 695,700 km mean radius on NASA's Sun fact sheet.

The third law, with mass in it

For a circular orbit the derivation fits in three lines. Gravity supplies the centripetal force:

G M m / r² = m v² / r
v = 2πr / T
T² = (4π² / (G M)) r³

For an ellipse, r becomes the semi-major axis a, and for two bodies of comparable mass M becomes M + m:

T² = 4π² a³ / (G (M + m))

This is the form engineers use. Note that G and M never appear separately in practice. The product GM, the standard gravitational parameter written μ, is known far more precisely than either factor. NIST's 2022 CODATA value of G is 6.67430 × 10⁻¹¹ m³ kg⁻¹ s⁻², with a relative standard uncertainty of 2.2 × 10⁻⁵. JPL's astrodynamic parameters page gives Earth's GM as 398,600.435507 km³/s² and the Sun's as 1.32712440041279419 × 10²⁰ m³/s², numbers known to many more digits because they come from tracking orbits directly. Dividing Earth's GM by G gives Earth's mass, about 5.972 × 10²⁴ kg, which matches NASA's fact sheet, and the uncertainty in that mass is set almost entirely by G.

When you use μ instead of G and M, the third law becomes:

T = 2π √(a³ / μ)          a = (μ T² / (4π²))^(1/3)

Every worked example below uses one of those two lines.

Worked example 1: Mars's orbital period from its semi-major axis

Question. JPL's table of mean orbital elements, valid from 1800 to 2050, gives Mars a semi-major axis of 1.52371034 au. How long is a Martian year?

Kepler's way. In years and astronomical units, T = a^1.5:

T = 1.52371034^1.5 = 1.8808 years

To convert to days, use the sidereal year, 365.25636 days on JPL's astrodynamic parameters page, because the third law is about orbits measured against the stars:

T = 1.8808 × 365.25636 = 687.0 days

NASA's Mars fact sheet gives a sidereal orbit period of 686.980 days, a ratio of 1.881 to Earth's. The third law, using one number and no physics constant, lands within a fraction of a day.

Newton's way. Convert a to metres with the IAU's exact astronomical unit (1 au = 149,597,870,700 m) and use the Sun's GM:

a = 1.52371034 × 149,597,870,700 m = 2.27944 × 10¹¹ m
T = 2π √(a³ / 1.32712440041 × 10²⁰) = 5.9355 × 10⁷ s = 687.0 days

The answers agree because the "years and au" form is just Newton's form with the Sun's GM hidden in the units. That also explains NASA's warning that the p² = a³ shortcut only works for objects in our own solar system: it assumes the central mass is the Sun.

A cross check from the fact sheet. NASA's Mars sheet gives a = 227.956 million km. Plugging that into the same formula also returns 687.0 days. Two independent NASA products, the long term mean elements and the fact sheet, agree through the third law.

Worked example 2: the altitude of a geostationary orbit

Question. A geostationary satellite stays over one point on the equator. What altitude does it need?

Step 1: pick the right period. The satellite must complete one orbit while Earth turns once relative to the stars, not relative to the Sun. That is the sidereal day. JPL gives the mean sidereal day as 86,164.09054 s, which is 23 hours 56 minutes 4.09 seconds. ESA's description of geostationary orbit gives the same 23 hours 56 minutes 4 seconds.

Step 2: apply the third law with Earth's GM.

a = (μ T² / 4π²)^(1/3)
  = (3.98600435507 × 10¹⁴ × 86,164.09054² / 4π²)^(1/3)
  = 42,164.2 km

Step 3: subtract Earth's radius. For an equatorial orbit, use the equatorial radius, 6,378.137 km on NASA's Earth fact sheet:

altitude = 42,164.2 − 6,378.1 = 35,786.0 km

ESA gives 35,786 km. The orbital speed is 2πa / T = 3.075 km/s, which matches ESA's "about 3 km per second".

What goes wrong with 24 hours. Using a solar day of 86,400 s gives a = 42,241 km and an altitude of 35,863 km, 77 km too high. A satellite parked there would drift slowly westward against the ground, by roughly one degree of longitude a day. The four minute difference between solar and sidereal days is the most common error in this calculation.

Why it must be equatorial. The third law fixes the radius but not the plane. An inclined orbit with the same period is geosynchronous but wanders north and south each day; ESA describes GEO satellites as flying above the equator, west to east, exactly matching Earth's rotation.

Worked example 3: the period of a satellite at 550 km

Question. A satellite in a circular low Earth orbit 550 km above the surface. How long is one orbit, and how fast is it moving? (550 km is an illustrative altitude used by some broadband constellation shells; we chose it because it is in the middle of the band ESA defines as low Earth orbit, below 2,000 km.)

Step 1: semi-major axis. For a circular orbit, a is Earth's radius plus altitude:

a = 6,378.137 + 550 = 6,928.137 km = 6.928137 × 10⁶ m

Step 2: period.

T = 2π √(a³ / μ) = 2π √((6.928137 × 10⁶)³ / 3.98600435507 × 10¹⁴)
  = 5,739 s = 95.65 minutes

Step 3: speed and orbits per day.

v = √(μ / a) = 7.585 km/s
orbits per day = 86,400 / 5,739 = 15.05

ESA quotes about 7.8 km/s and about 90 minutes for LEO in general; those are typical of lower orbits. Run the same script at 400 km and you get 92.56 minutes and 7.669 km/s; at 2,000 km, the top of ESA's LEO band, 127.2 minutes and 6.898 km/s.

What it means in practice. A satellite that laps Earth 15 times a day is above any one ground terminal for only minutes per pass, which is why low orbit systems need very many satellites and terminals that hand off between them. How satellite internet works covers the system side.

Worked example 4: a GPS satellite's period and altitude

Question. GPS.gov says GPS satellites fly in medium Earth orbit at an altitude of approximately 20,200 km and that each satellite circles the Earth twice a day. Are those two statements consistent?

Step 1: what "twice a day" means. For the ground track to repeat, a GPS satellite completes two orbits per sidereal day, so its period is half a sidereal day:

T = 86,164.09054 / 2 = 43,082.05 s = 11.967 hours, about 11 h 58 min

Step 2: semi-major axis.

a = (μ T² / 4π²)^(1/3) = 26,561.8 km

Step 3: altitude.

altitude = 26,561.8 − 6,378.1 = 20,183.6 km

That is 20,200 km to three significant figures, so GPS.gov's two numbers agree through the third law. Running it the other way, an altitude of exactly 20,200 km gives a period of 11.978 hours. The orbital speed is √(μ / a) = 3.874 km/s.

Why GPS chose this orbit. The repeat matters. A ground track that repeats every sidereal day means the geometry of satellites over a given place repeats too, about four minutes earlier each solar day. GPS.gov describes the constellation as six equally spaced orbital planes with four baseline slots each, a 24 slot arrangement that lets users see at least four satellites from virtually anywhere. Since the "Expandable 24" change completed in June 2011, according to GPS.gov, three slots were expanded so the system effectively operates as a 27 slot constellation. GPS.gov reported 31 operational satellites as of 3 July 2023.

The third law places the satellites; turning their signals into a position is a separate problem, covered in the GPS and GNSS post.

Worked example 5: the second law in numbers, from Mars to a highly elliptical orbit

The second law says a body moves fastest at its closest point. Here is how much faster, three ways.

Mars at perihelion and aphelion

Using r_p v_p = r_a v_a:

v_p / v_a = r_a / r_p = 249.261 / 206.650 = 1.206

For the absolute speeds, combine energy conservation with the third law to get the vis viva equation, v² = μ (2/r − 1/a). With the Sun's GM and Mars's fact sheet distances:

v_p = √(μ (2/r_p − 1/a)) = 26.50 km/s
v_a = √(μ (2/r_a − 1/a)) = 21.97 km/s

NASA's Mars fact sheet lists a maximum orbital velocity of 26.50 km/s and a minimum of 21.97 km/s. The ratio 26.50 / 21.97 = 1.206, exactly the distance ratio, as the second law requires. Earth's gentler orbit gives 30.29 km/s at perihelion and 29.29 km/s at aphelion, also matching its fact sheet.

An illustrative highly elliptical satellite orbit

Satellites that need to linger over high latitudes use the second law on purpose. Take an illustrative twelve hour orbit (half a sidereal day, the same period as GPS, so a = 26,562 km) with a perigee only 600 km above the surface:

r_p = 6,378 + 600     = 6,978 km
r_a = 2a − r_p        = 46,146 km   (apogee altitude about 39,767 km)
e   = (r_a − r_p) / (r_a + r_p) = 0.737
v_p = 9.96 km/s       v_a = 1.51 km/s

The satellite is more than six times faster at perigee than at apogee. Solving Kepler's equation (shown in the walkthrough) for the time spent on the apogee side of the orbit, beyond the line through Earth perpendicular to the major axis, gives about 92 percent of each orbit. Put apogee over the northern hemisphere and the satellite spends most of each twelve hours high in the northern sky, then whips through perigee in the south. A circular orbit cannot do that; an ellipse and the second law can.

Worked example 6: from a two line element set to an altitude

Question. When we fetched it on 24 October 2026, CelesTrak's current element set for the International Space Station (epoch day 296 of 2026, that is 23 October) read:

ISS (ZARYA)
1 25544U 98067A   26296.69304404  .00008515  00000+0  16237-3 0  9995
2 25544  51.6336  24.1765 0006871 300.7285  59.3026 15.49021515591674

What is the station's orbital period and mean altitude?

Step 1: read the mean motion. CelesTrak's format documentation puts the mean motion, in revolutions per day, in columns 53 to 63 of line 2. Here it is 15.49021515.

Step 2: period.

T = 86,400 / 15.49021515 = 5,577.6 s = 92.96 minutes

Step 3: semi-major axis from the third law.

a = (μ T² / 4π²)^(1/3) = 6,797.7 km
mean altitude ≈ 6,797.7 − 6,378.1 = 420 km

The eccentricity field (columns 27 to 33, leading decimal point assumed) reads 0006871, so e = 0.0006871. Perigee and apogee therefore differ by about 2ae ≈ 9 km, and the orbit is almost circular. The inclination, 51.6336 degrees, is the tilt of the orbit to the equator.

This is a back of the envelope result. TLE mean motion is a Brouwer mean element defined for the SGP4 propagator, as CelesTrak explains, not a pure two body quantity, and altitude above a spherical Earth ignores the equatorial bulge. Within a few kilometres, though, the third law turns one number in a decades old text format into a physically meaningful altitude.

Table: checking the third law across the planets

The table uses JPL's long term mean semi-major axes (valid 1800 to 2050) and the sidereal periods from NASA's individual planet fact sheets. If the third law were exact, T² / a³ would be exactly 1.

Planeta (au, JPL)a³Sidereal period (days, NASA)T (years)T²T² / a³Predicted T (days)Difference
Mercury0.38710.05887.9690.24080.0581.000088.0+0.00%
Venus0.72330.378224.7010.61520.3781.0000224.7+0.00%
Earth1.00001.000365.2561.00001.0001.0000365.3+0.00%
Mars1.52373.538686.9801.88083.5371.0000687.0+0.00%
Jupiter5.2029140.8424,332.58911.8618140.7020.99904,334.8+0.05%
Saturn9.5367867.34310,755.69929.4470867.1250.999710,757.1+0.01%
Uranus19.18927,065.91230,685.40084.01067,057.7780.998830,703.1+0.06%
Neptune30.069927,189.23260,189.018164.785727,154.3210.998760,227.7+0.06%

Two things stand out. First, the law holds to better than a tenth of a percent across a factor of almost 80 in distance and almost 700 in period. Second, the outer planets come out slightly fast. Some of that is Newton's correction: T² = 4π²a³ / (G(M + m)) gives a slightly shorter period when the planet's own mass adds to the Sun's. JPL lists the Jupiter system's GM as 126,712,764.1 km³/s², about 0.000955 of the Sun's. Including it shortens Jupiter's predicted period by about 0.048 percent, from 4,334.8 to 4,332.7 days, almost exactly NASA's 4,332.589. The rest comes from the planets pulling on each other and from the difference between long term mean elements and the elements at any given moment.

A trap in the summary table

NASA's one page planetary fact sheet lists an "Orbital Period" row, but its notes define that as the tropical period, the time from one vernal equinox to the next. For Neptune that is 59,800 days, against a sidereal period of 60,189 days on Neptune's own fact sheet. If you test the third law with the tropical periods, Neptune appears to miss by 1.4 percent and you might conclude the law is breaking down. It is not. The tropical period is shorter because the equinox itself drifts with precession. Kepler's law is about the orbit measured against the stars, so use sidereal periods.

Satellites around Earth

The same check works for satellites, with μ for Earth in place of the Sun's.

OrbitSemi-major axisAltitudePeriodSpeedSource of the input
ISS (element set, 24 Oct 2026)6,797.7 kmabout 420 km92.96 min7.66 km/sCelesTrak TLE mean motion
Illustrative LEO6,928.1 km550 km95.65 min7.585 km/sChosen altitude
LEO upper bound8,378.1 km2,000 km127.2 min6.898 km/sESA LEO definition
GPS (MEO)26,561.8 km20,184 km11.967 h3.874 km/sGPS.gov, two orbits per sidereal day
Geostationary42,164.2 km35,786 km23 h 56 min 4 s3.075 km/sJPL sidereal day; ESA
Moon384,400 kmnot applicable27.3217 days1.022 km/s (mean)NASA Moon fact sheet

For the Moon, plugging 384,400 km into the third law with Earth's GM alone gives 27.45 days, against the 27.3217 day revolution period on NASA's Moon fact sheet. Adding the Moon's own GM, 4,902.8 km³/s² from JPL, brings the prediction to 27.28 days. The Moon is about 1.2 percent of Earth's mass, so the M + m term matters; the Sun's pull on the pair accounts for most of the rest.

What do orbital elements and two line element sets describe?

The six classical Kepler elements

A Kepler orbit in space needs six numbers: two for its size and shape, three for its orientation, and one for where the body is along it at a given time.

ElementSymbolWhat it describesTLE field (CelesTrak)
Semi-major axisaSize of the ellipse; fixes the period through the third lawNot stored; derived from mean motion
EccentricityeShape, 0 for a circleLine 2, columns 27 to 33, leading decimal assumed
InclinationiTilt of the orbital plane to the equatorLine 2, columns 9 to 16, degrees
Right ascension of the ascending nodeΩWhere the orbit crosses the equator going north, measured from a fixed directionLine 2, columns 18 to 25, degrees
Argument of perigeeωWhere perigee sits within the orbital planeLine 2, columns 35 to 42, degrees
Mean anomaly at epochMWhere the satellite is along the orbit at the epoch timeLine 2, columns 44 to 51, degrees
Epocht₀The moment the elements are valid forLine 1, columns 19 to 32

Mean anomaly is the bridge between the second law and a clock. It increases uniformly with time, by 360 degrees per orbit, even though the real angle around the orbit (the true anomaly) does not. Kepler's equation, M = E − e sin E, links mean anomaly M to the eccentric anomaly E, from which the position follows. It has no closed form solution, which is why every orbit library solves it with a few iterations of Newton's method. For a circular orbit the three anomalies are the same.

JPL's planetary table uses slightly different but equivalent choices: semi-major axis, eccentricity, inclination, mean longitude, longitude of perihelion and longitude of the ascending node, each with a rate of change per century. Those rates are an admission that the elements are not fixed, which leads to the next section.

The two line element format

CelesTrak documents the NORAD two line element set format, the same format used by NORAD and NASA. An optional line 0 holds a 24 character name. Line 1 carries the catalogue number, classification, international designator, the epoch (two digit year plus fractional day of year), mean motion derivatives, the BSTAR drag term and an element set number. Line 2 carries the elements in the table above plus the revolution number. Each line ends with a modulo 10 checksum in column 69: digits count their value, minus signs count 1, everything else 0. On the ISS example, line 1 sums to a value ending in 5 and line 2 to one ending in 4, matching their last digits. A failed checksum is the cheapest test that a line was corrupted in copying.

How operators and trackers use element sets

CelesTrak explains that the US government has provided these general perturbations (GP) data to the world since the 1970s, produced by fitting observations from the US Space Surveillance Network to Brouwer mean elements for the SGP4 propagator. In practice, element sets are used for:

  • Pass prediction: propagate the elements forward to find when a satellite rises over a site and where to point an antenna.
  • Conjunction screening: compare predicted positions against the catalogue to flag close approaches; CelesTrak's site lists its SOCRATES screening service.
  • Catalogue maintenance and research: each new set refines the last (the epoch and element set number tell you which is newer), and the history supports decay and debris studies.

Two cautions follow. TLE elements are SGP4 mean elements, so use SGP4 rather than a pure Kepler propagator. And they age: the python-sgp4 documentation notes that satellites deviate from the ideal orbits in TLE files by 1 to 3 km per day.

The format is running out of numbers

The TLE format allows only five digits for the catalogue number. CelesTrak announced in May 2020 that it was serving the same data as CCSDS Orbit Mean Elements Messages (OMM, from CCSDS 502.0-B-3) in XML, KVN, JSON and CSV forms, which allow catalogue numbers of up to nine digits, and that the two digit year inherited a lingering Y2K problem. Its data formats page now carries a notice that it ran out of five digit catalogue numbers on 11 July 2026, that newly catalogued objects have six digit numbers of 100,000 and up, and that GP data for them is not available in TLE format. The same page says the default output format for its GP queries has been CSV since 9 May 2026. Any software that parses tracking data by fixed column positions needs to move to OMM to see new objects at all.

Where are Kepler's laws only approximate?

Kepler's laws are exact for two point masses, or two spheres, alone in space. Nothing real is that isolated. Here are the main ways real orbits depart from a fixed ellipse, roughly from largest to smallest for a typical Earth satellite.

Earth is not a sphere

NASA's Earth fact sheet lists Earth's J2 coefficient as 1,082.63 × 10⁻⁶. J2 measures the equatorial bulge, and for low orbits it is the largest departure from Kepler. Its main effect is to make the orbital plane rotate slowly around Earth's axis (nodal regression) and the perigee rotate within the plane. Using the standard first order formula for nodal regression, the ISS's plane at 51.6 degrees inclination swings westward by about 5.0 degrees per day, and a 550 km orbit at 53 degrees by about 4.5 degrees per day. GPS, much farther out, regresses by only about 0.04 degrees per day.

Operators exploit this. Tilt a low orbit just past polar, about 97.6 degrees at 550 km, and the bulge turns the plane eastward by about 0.9856 degrees per day, the same rate Earth moves around the Sun. The orbit then keeps a fixed angle to the Sun, which is what ESA calls a Sun synchronous orbit. A pure Kepler orbit could never do that; the bulge does it for free.

The atmosphere is not a vacuum

In low orbit, drag removes energy every orbit. The semi-major axis shrinks and, paradoxically, the satellite speeds up as it sinks, because lower orbits are faster by the third law. TLE line 1 carries the BSTAR term and the mean motion derivative because drag is not in Kepler's model; the ISS set above has a positive first derivative, meaning its mean motion is rising as it sinks. ESA notes that satellites generally do not fly below about 180 km.

Other bodies pull too

The Moon and the Sun perturb high orbits, and for geostationary satellites they slowly tilt the orbit so that station keeping manoeuvres are needed. Among the planets, Jupiter's pull is the largest. JPL's mean element table includes rates of change per century for every element for exactly this reason, and it limits the table's validity to 1800 to 2050.

Relativity and Mercury's perihelion

Even with every planet accounted for, Newton's gravity leaves a small residual in Mercury's orbit. OpenStax explains that Mercury's perihelion slowly advances, that most of the advance comes from the pull of other planets, that a small portion could not be accounted for by Newton's law, and that general relativity correctly predicts the measurements. NASA's orbits page notes that modern spacecraft trajectory planning and planetary mass measurements go a step beyond Newton and account for relativity to reach the precision modern science and spaceflight need. JPL's planetary ephemerides, the DE440 series cited on the astrodynamic parameters page, are built that way.

Which approximation to use when

TaskGood enoughWhy
Classroom period or altitude estimateKepler's third law with μErrors well under 1 percent for near circular orbits
Planetary period to a few daysT² = a³ in years and auWithin 0.1 percent for every planet
Planetary positions for planning observationsJPL mean elements with rates, 1800 to 2050Adds secular drift of the elements
Satellite pass predictionSGP4 with a recent TLE or OMMIncludes J2, drag and other effects; the elements are fitted for it
Spacecraft navigation, ephemeridesNumerical integration with relativity (JPL Horizons, DE440)Highest precision; every perturbation modelled

JPL Horizons, linked from the Solar System Dynamics site, is the public way to get those high precision positions for solar system bodies without building a model yourself.

Walkthrough: reproduce every number in Python

You can check every result in this post with a short script and one well known library. Treat a scientific script like any other software: pin its environment so it gives the same answer next year on another machine.

Step 1: create a clean, pinned environment

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install "sgp4==2.27"
python -m pip freeze > requirements.txt

On the next machine, install exactly those versions:

python -m pip install -r requirements.txt

The sgp4 package on the Python Package Index was at version 2.27 when we checked, and its metadata excludes Python 3.9 and older, so use Python 3.10 or newer (on an older interpreter pip falls back to an earlier release; the script below also ran on 2.25 and printed a radius of 6,801.1 km and a speed of 7.657 km/s). Its documentation describes it as an implementation of the SGP4 propagator whose positions agree with the standard version of the algorithm to within 0.1 mm, and it falls back to a slower pure Python implementation if its compiled accelerator is unavailable.

Step 2: write the Kepler calculations

Save this as kepler_examples.py:

import math

GM_SUN = 1.32712440041279419e20   # m^3/s^2, JPL astrodynamic parameters
GM_EARTH = 3.98600435507e14       # m^3/s^2, JPL (DE440)
GM_JUP = 1.267127641e17           # m^3/s^2, JPL, Jupiter system
AU = 149_597_870_700.0            # m, IAU 2012 Resolution B2
SIDEREAL_DAY = 86164.09054        # s, JPL
SIDEREAL_YEAR = 365.25636         # days, JPL
R_EQ = 6378.137e3                 # m, NASA Earth fact sheet
DAY = 86400.0

def period(a, mu):
    return 2 * math.pi * math.sqrt(a**3 / mu)

def sma(T, mu):
    return (mu * T**2 / (4 * math.pi**2)) ** (1 / 3)

# Example 1: Mars
a = 1.52371034
print(f"Mars: {a**1.5:.4f} yr = {a**1.5 * SIDEREAL_YEAR:.1f} d; "
      f"Newton {period(a * AU, GM_SUN) / DAY:.1f} d")

# Example 2: geostationary
r = sma(SIDEREAL_DAY, GM_EARTH)
print(f"GEO: a={r/1e3:,.1f} km alt={(r - R_EQ)/1e3:,.1f} km "
      f"v={2*math.pi*r/SIDEREAL_DAY/1e3:.3f} km/s")

# Example 3: circular LEO
for h in (400e3, 550e3, 2000e3):
    a = R_EQ + h
    T = period(a, GM_EARTH)
    print(f"LEO {h/1e3:.0f} km: {T/60:.2f} min, {math.sqrt(GM_EARTH/a)/1e3:.3f} km/s")

# Example 4: GPS, two orbits per sidereal day
a = sma(SIDEREAL_DAY / 2, GM_EARTH)
print(f"GPS: a={a/1e3:,.1f} km alt={(a - R_EQ)/1e3:,.1f} km")

# Example 5: second law with vis viva
def vis_viva(r, a, mu):
    return math.sqrt(mu * (2 / r - 1 / a))

rp, ra = 206.650e9, 249.261e9          # Mars, NASA fact sheet
a = (rp + ra) / 2
print(f"Mars vp={vis_viva(rp, a, GM_SUN)/1e3:.2f} "
      f"va={vis_viva(ra, a, GM_SUN)/1e3:.2f} km/s")

a = sma(SIDEREAL_DAY / 2, GM_EARTH)    # illustrative HEO
rp = R_EQ + 600e3
ra = 2 * a - rp
e = (ra - rp) / (ra + rp)

def mean_anomaly(nu, e):
    E = 2 * math.atan(math.sqrt((1 - e) / (1 + e)) * math.tan(nu / 2))
    return E - e * math.sin(E)       # Kepler's equation

far = 2 * (math.pi - mean_anomaly(math.pi / 2, e)) / (2 * math.pi)
print(f"HEO e={e:.3f} vp={vis_viva(rp, a, GM_EARTH)/1e3:.2f} "
      f"va={vis_viva(ra, a, GM_EARTH)/1e3:.2f} km/s, far side {far:.0%}")

# Example 6: ISS from TLE mean motion
n = 15.49021515
a = sma(DAY / n, GM_EARTH)
print(f"ISS: T={DAY/n/60:.2f} min a={a/1e3:,.1f} km alt={(a - R_EQ)/1e3:.0f} km")

# Newton's correction for Jupiter
a = 5.20288700 * AU
print(f"Jupiter: Kepler {period(a, GM_SUN)/DAY:,.1f} d, "
      f"with planet mass {period(a, GM_SUN + GM_JUP)/DAY:,.1f} d")

Step 3: run it and compare

python kepler_examples.py

Expected output, rounded:

Mars: 1.8808 yr = 687.0 d; Newton 687.0 d
GEO: a=42,164.2 km alt=35,786.0 km v=3.075 km/s
LEO 400 km: 92.56 min, 7.669 km/s
LEO 550 km: 95.65 min, 7.585 km/s
LEO 2000 km: 127.20 min, 6.898 km/s
GPS: a=26,561.8 km alt=20,183.6 km
Mars vp=26.50 va=21.97 km/s
HEO e=0.737 vp=9.96 va=1.51 km/s, far side 92%
ISS: T=92.96 min a=6,797.7 km alt=420 km
Jupiter: Kepler 4,334.8 d, with planet mass 4,332.7 d

Step 4: validate and propagate a real element set

Save this as propagate_tle.py, pasting a current element set from CelesTrak in place of the example lines:

from sgp4.api import Satrec, jday

L1 = "1 25544U 98067A   26296.69304404  .00008515  00000+0  16237-3 0  9995"
L2 = "2 25544  51.6336  24.1765 0006871 300.7285  59.3026 15.49021515591674"

def checksum_ok(line):
    total = 0
    for ch in line[:68]:
        if ch.isdigit():
            total += int(ch)
        elif ch == "-":
            total += 1
    return total % 10 == int(line[68])

assert checksum_ok(L1) and checksum_ok(L2), "TLE checksum failed"

sat = Satrec.twoline2rv(L1, L2)
jd, fr = jday(2026, 10, 24, 12, 0, 0)
err, r, v = sat.sgp4(jd, fr)
if err:
    raise SystemExit(f"SGP4 error code {err}")
radius = sum(x * x for x in r) ** 0.5
speed = sum(x * x for x in v) ** 0.5
print(f"radius {radius:,.1f} km, speed {speed:.3f} km/s")

The sgp4 documentation's own example uses Satrec.twoline2rv, jday and sgp4(jd, fr) exactly this way. It returns an error code, a position in kilometres and a velocity in kilometres per second in the TEME frame, and it warns that converting to Earth fixed coordinates or latitude and longitude needs a fuller astronomy library. The radius you get should be within a few kilometres of 6,800 km, and the speed close to 7.66 km/s, the third law's answer for that radius.

If your data source has moved to OMM, the same library documents an omm module that initialises a satellite from OMM fields, which is how you will read objects with six digit catalogue numbers.

Step 5: keep the script's dependencies healthy

A calculation or pass prediction script is software with a dependency tree, however small. If it lives in a repository next to a ground station service or a tracking dashboard, scan it like the rest of your code. With the Safeguard CLI installed, safeguard scan --dir . scans the project directory, including requirements.txt, and writes JSON results under ./output.

Common mistakes

  • Using a 24 hour day for geostationary orbit. The period is the sidereal day, 23 h 56 min 4 s. Using 86,400 s puts the satellite about 77 km too high.
  • Forgetting to subtract Earth's radius. The third law gives the distance from Earth's centre. Altitude is that minus about 6,378 km at the equator.
  • Mixing units. μ for Earth is 398,600.4 km³/s² or 3.986 × 10¹⁴ m³/s². Put kilometres into the metre version and the period is off by a factor of about 31,600.
  • Using T² = a³ for satellites. That shortcut, in years and au, assumes the Sun is the central mass. Around Earth, use Newton's form with Earth's μ.
  • Using tropical instead of sidereal periods. The third law describes orbits measured against the stars. NASA's summary fact sheet lists tropical periods, which make Neptune appear to miss by 1.4 percent.
  • Putting the Sun at the centre of the ellipse. It sits at a focus, offset by a × e.
  • Feeding TLE elements into a pure Kepler propagator. TLE values are SGP4 mean elements. Use SGP4, and use fresh elements.
  • Parsing TLEs by column with no checksum check, and no plan for six digit catalogue numbers. Both break silently. Validate the checksum and move to OMM.

FAQ

What are Kepler's three laws in simple terms?

Orbits are ellipses with the Sun off centre at one focus; planets move faster when closer to the Sun so the Sun to planet line sweeps equal areas in equal times; and the period squared is proportional to the distance cubed.

What is the formula for Kepler's third law?

For bodies orbiting the Sun, with the period in years and the semi-major axis in astronomical units, T² = a³. For any two bodies, Newton's form is T² = 4π²a³ / (G(M + m)), usually written with the gravitational parameter μ as T = 2π√(a³/μ).

When did Kepler publish his laws?

The first and second laws appeared in Astronomia Nova in 1609. The third law appeared in Harmonices Mundi in 1619. Both dates are given by NASA Science and the MacTutor archive.

Why do planets move faster at perihelion?

Gravity acts along the line to the Sun, so it cannot change the planet's angular momentum. With angular momentum fixed, a shorter distance requires a higher sideways speed. NASA's Mars fact sheet shows it: 26.50 km/s at perihelion, 21.97 km/s at aphelion.

How high is a geostationary orbit?

About 35,786 km above the equator, or 42,164 km from Earth's centre. That is the radius at which a circular orbit takes one sidereal day, 23 hours 56 minutes 4 seconds, according to both the third law and ESA.

How long does it take a satellite to orbit Earth?

It depends on altitude through the third law. About 92 to 93 minutes at 400 to 420 km, the ISS's altitude; about 95.6 minutes at 550 km; just under 12 hours for GPS at about 20,200 km; and one sidereal day for geostationary orbit.

Do Kepler's laws apply to satellites and moons?

Yes. Earth replaces the Sun, perigee and apogee replace perihelion and aphelion, and Newton's form with Earth's μ replaces T² = a³.

How did Newton prove Kepler's laws?

A central force conserves angular momentum, which gives the area law; an inverse square force produces conic section orbits, which gives ellipses for bound orbits; and gravity plus his second law of motion gives the third law with the masses included. He published it in the Principia in 1687.

Are Kepler's laws exact?

No. They are exact only for two isolated bodies. Other planets, Earth's equatorial bulge, atmospheric drag, solar radiation pressure and general relativity all perturb real orbits. The small part of Mercury's perihelion advance that Newton's law cannot explain, and general relativity does, is the classic case.

What is a two line element set?

A compact text format, documented by CelesTrak, that encodes a satellite's orbital elements at an epoch, along with drag terms and checksums, for use with the SGP4 propagator. It is being replaced by the CCSDS Orbit Mean Elements Message because its five digit catalogue numbers ran out in July 2026.

The software that tracks the satellites: an honest bridge

Kepler's laws are physics, and Safeguard does not do physics. Its models are single purpose security models for software; they do not compute orbits, propagate element sets, analyse spacecraft or inspect hardware, and nothing in this post was calculated by them. The connection is narrower and real. Ground station software, pass predictors, conjunction screening tools, tracking dashboards and scripts like the one in the walkthrough are software, and much of the code around them is built from open source dependencies: orbit propagation libraries, numerical packages, web frameworks, parsers for TLE and OMM data. Where Safeguard helps is there: scanning those repositories, container images and SBOM files for known vulnerable open source components, showing which projects carry a given version, and, when a fixed version exists, opening an upgrade pull request for review.

Every rebuild of a tracking service or ground station tool pulls its dependencies again, and the parsers, numerical libraries and web stacks that handle orbital data ship open source components with their own vulnerability histories. The fit is indirect for the orbital mechanics, but for the code your team builds and ships around it the same dependency hygiene applies, and the section below shows how to close the gap whether or not upstream has a fix yet.

Fix it without waiting for upstream

Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.

1. Autonomous remediation: pull requests, not tickets

When a fixed version exists, Safeguard's Griffin models open a tested, policy gated pull request that moves the affected dependency to the safe version. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation covers eight categories, including dependencies, licenses, security posture and findings. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Autonomous remediation ships switched off, with every category set to Manual, so your team decides how much runs on its own and what still needs a human approval.

2. Gold Open Source: the safe version in seconds, free

gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds. The safeguard-sh/gold-scan-action GitHub Action can fail a build on a known exploited vulnerability, on any known vulnerability, or never, so a version you have just removed cannot quietly come back in next week's merge.

3. Gold Registry: start from components that are already fixed

registry.safeguard.sh provides hardened, drop in replacements for upstream packages and container images. Every Gold artifact is held continuously to zero exploitable critical or high CVEs, zero malware and a completed license check, with SLSA L3 or higher provenance, a Sigstore signature and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.

When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened, compatibility tested build of a specific package. This fork and patch flow is in early access today, so ask which packages it covers before you plan around it.

Your situationWhat to use
A fixed version existsAutonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version
You need to know today whether you are affectedGold Open Source lookup and "Am I affected?" checker, free and without login
You want vulnerable versions to stop shippingThe Gold scan GitHub Action in CI, plus Safeguard policies and gates
Upstream has no fix yet, or will not ship oneA custom Gold request; fork and patch (early access)
You want to start clean on new projectsPull hardened components and images from Gold Registry

One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.

See how Safeguard would help

None of these demos involve orbital calculations; they show the software side described in the bridge above.

The first demo is a real Safeguard CLI session: it installs the CLI, opens the interactive terminal and asks it to fix a lodash CVE in a repository. It reads the finding and advisory, asks before each command, edits package.json to lodash 4.17.21, runs npm install and npm test with approval, prints a summary and pushes nothing. The same flow applies to a satellite tracking web dashboard your team maintains: scan the repository, then let the assistant propose the dependency upgrade under your approval.

Click through it at your own pace, or open it full screen.

The second demo sets up the Safeguard runner on your own machine, approves it with its device code and then scans from the terminal. That suits teams who keep ground station tooling, pass prediction scripts or orbit analysis notebooks on their own hardware and want the scan to run where the code lives.

Click through it at your own pace, or open it full screen.

The third demo connects Claude to the Safeguard MCP server with OAuth and lets you choose which tools Claude can use. For an engineer who already works with Claude while writing a tracking service, it brings dependency findings into the same conversation, limited to the tools you allow.

Click through it at your own pace, or open it full screen.

To try it on your own repositories, download Safeguard and follow the CLI documentation.

Quick check

A planet orbits the Sun with a semi-major axis of 4 au. What is its period?

T = 4^1.5 = 8 years. Squaring gives 64, and 4 cubed is also 64, so T² = a³ holds.

Why does a geostationary calculation use 86,164 seconds instead of 86,400?

A geostationary satellite has to keep pace with Earth's rotation relative to the stars, which takes one sidereal day, 23 h 56 min 4 s. Using the 24 hour solar day puts the orbit about 77 km too high, and the satellite drifts against the ground.

A satellite's element set gives a mean motion of 15.05 revolutions per day. Roughly how high is it?

The period is 86,400 / 15.05 = 5,741 s. The third law with Earth's μ gives a semi-major axis of about 6,928 km, so the altitude is about 550 km.

Sources

Last reviewed: 24 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.