Kepler’s Third Law & Two-Body Orbit Calculator

Compare two ideal two-body orbits. Solve for the period, the semimajor axis of the relative orbit or the combined gravitational parameter. Inspect how the companion changes predicted timing, compare entered period bounds and separate ellipse geometry from the individual barycentric orbit sizes.

Two-body orbits

Compare periods, relative orbits and combined gravity

Solve one unknown in each case. Compare measured timing and separate relative geometry from the two barycentric orbits.

A · Orbital period
27.284605798 d
Earth–Moon illustration
B · Orbital period
27.451893789 d
Primary-only comparison
Edit units and orbital cases

Use the semimajor axis of the separation between the two bodies. Accepts decimal and exact fraction entries. Eccentricity and observed bounds are optional.

Case A · Earth–Moon illustration

A blank companion uses the primary-only approximation.

Case B · Primary-only comparison

A blank companion uses the primary-only approximation.

Predicted period and observed interval

Compare by

The marker is the case’s computed or entered orbital period. Green shows the observed interval on that case’s scale.

Within observed period interval27.284605798 d
Observed minimum
27.2 d
Observed maximum
27.35 d
Above observed period interval27.451893789 d
Observed minimum
27.2 d
Observed maximum
27.35 d

Two-body calculation ledger

Earth–Moon illustration

Relative orbit

Relative semimajor axis
384,400 km
Orbital period
27.284605798 d
Semiminor axis
383,820.270120439 km
Periapsis
363,296.44 km
Apoapsis
405,503.56 km
Primary axis about barycenter
4,670.684641326 km
Companion axis about barycenter
379,729.315358674 km

Gravitational parameters

Entered primary and companion

Total GM
403,503.235625 km³/s²
Primary GM
398,600.435507 km³/s²
Companion GM
4,902.800118 km³/s²
Primary-only period excess
0.613122257 %

Total GM from the observed period bounds

Lower
401,575.979566013 km³/s²
Upper
406,017.33912051 km³/s²
Download orbit comparison CSV
Show selectable CSV

How to use this calculator

  1. Choose the lengths, times and gravitational parameter or mass units.
  2. For each case, select the quantity to calculate and record the other quantities. Use the semimajor axis of the relative orbit.
  3. Enter any documented companion parameter, eccentricity and interval between measured or accepted periods.
  4. Compare the interval check, orbit shape, barycentric split and primary-only period change.
  5. Export both scenarios, assumptions and calculated SI values as CSV.

The Formula

The mathematical logic powering this calculation is:

For a bound Newtonian two-body relative orbit, let a be the semimajor axis of the separation between the two bodies. A semimajor axis measured about the barycenter for one body is a different quantity. With period T and combined gravitational parameter μ = G(M₁ + M₂) = μ₁ + μ₂, Kepler’s law is T² = 4π²a³ ÷ μ. Solve this equation for the selected unknown. A day is exactly 86,400 s, a Julian year is 365.25 d and the astronomical unit is exactly 149,597,870,700 m. Enter gravitational parameters directly when known. The kilograms option uses G = 6.67430 × 10⁻¹¹ m³/(kg·s²), a measured constant. Solar GM units use JPL’s DE440 value of 1.32712440041279419 × 10²⁰ m³/s².

For period or axis mode, a blank companion uses the primary-only approximation. Entry of a documented zero is distinct. Total-GM mode uses a and T. With a known primary, inferred companion = total μ − primary μ. If this is negative the entries are inconsistent with a nonnegative companion under the ideal model. The calculated total remains available. Without a primary, allocation between components remains unknown.

When component GM is known or the companion is explicitly omitted by the selected approximation, the primary barycentric semimajor axis is a × μ₂ ÷ μ and the companion barycentric semimajor axis is a × μ₁ ÷ μ. Their sum is the relative semimajor axis. The primary-only period excess at the same relative axis is √(μ ÷ μ₁) − 1, reported as a percentage. A known companion increases μ and reduces period at fixed a.

Enter optional positive bounds for the observed period. The interval includes exact endpoints. The comparison uses squared period and does not rely on display rounding. When a relative axis was entered, each timing bound independently provides a total-GM bound under the two-body law. The maximum measured period provides the minimum inferred μ, and the minimum period provides the maximum inferred μ. Timing-derived GM bounds use an independently entered relative axis and therefore appear in period and total-GM modes.

For optional eccentricity e in [0,1), periapsis is a(1 − e), apoapsis is a(1 + e), and the semiminor axis is a√(1 − e²). Equal values at e = 0 describe a circle. The shape diagram separately normalizes each ellipse to its major diameter and marks the focus of the relative orbit. The accompanying ledger gives physical dimensions and any barycentric split.

Use positive a from 1 mm through 10²³ m, positive times from 1 microsecond through 10¹⁸ s and positive primary GM from 10⁻²⁰ through 10³⁵ m³/s². Companion GM may be zero and has the same upper bound. Enter up to twelve decimal places or exact fractions. The worksheet uses a fixed 49-decimal approximation of π, rational comparison and roots rounded to about 18 significant digits. The CSV retains raw entered values and reports calculated SI magnitudes to 15 significant digits.

Use the two-body model to compare theory and observations. For example, the published lunar mean orbital elements in the illustration describe a perturbed system. The worksheet’s illustrative timing window is user-entered. Tidal effects, other bodies, orbit evolution and current orbital position require other methods.

Worked Example

If you input:

  • Relative axis: 384,400 km in both cases
  • Orbital shape: Eccentricity 0.0549
  • Primary GM: 398,600.435507 km³/s²
  • Companion GM: 4,902.800118 km³/s² in the first case, omitted in the second
  • Timing window: Illustrative 27.2–27.35 days

Result:

With both GM values, modeled period is 27.284605798 days and falls inside the entered interval. The primary-only result at the same relative axis is 27.451893789 days, above the interval. It is approximately 0.613122257% higher than the paired result.

Frequently Asked Questions

What does the relative semimajor axis mean?

It is half the major diameter of the ellipse traced by the separation vector between the two bodies. One component’s orbit about the barycenter has its own smaller or equal semimajor axis.

Should I enter mass or GM?

Use documented GM directly when available. With kilograms selected, the worksheet converts each mass using the stated value of G and labels the equivalent mass units.

Why does omitting the companion increase the period?

At fixed relative semimajor axis, period is inversely proportional to the square root of combined GM. Entering a positive companion increases that parameter.

What if the inferred total is smaller than an entered primary?

The entered period and relative axis imply a total that cannot accommodate the primary together with a nonnegative companion under this ideal model. The worksheet retains the inferred total for inspection.

Does eccentricity change the period?

At a fixed relative semimajor axis and combined GM, no. Eccentricity redistributes the distance along the ellipse, changing periapsis and apoapsis.

Similar Calculators