All Tools
STEM

Celestial Mechanics & Orbit Simulator

Interactive n-body gravitational physics playground. Simulate Newton's law of universal gravitation, Keplerian planetary orbits, Hohmann transfers, Lagrange equilibrium points, and gravitational slingshots with long-term energy conservation.

Astrophysics Classical Mechanics

t = 0.0 days Bodies: 0 1.0×
Click body to select • Drag empty space to pan • Click & drag to launch new body
Active Celestial Bodies 0
Orbital Elements & Telemetry Inspector None Selected
Select a body from the list on the left or click directly on a planet in the simulator to inspect orbital parameters.
Velocity (v)
0.00 km/s
Distance (r)
0.00 AU
Eccentricity (e)
0.000
Semi-Major Axis (a)
0.00 AU
Orbital Period (T):
Periapsis (closest rp):
Apoapsis (furthest ra):
Specific Orbital Energy (ε):
Vis-Viva Live Substitution
v2 = GM (2/r − 1/a)
10
Johannes Kepler's Laws of Planetary Motion (1609–1619)
1. Law of Ellipses
r(θ) = a(1 − e2) / (1 + e cos θ)

The orbit of a planet is an ellipse with the Sun located at one of the two focal points (foci). The orbital eccentricity e measures departure from a perfect circle: e = 0 (Circle), 0 < e < 1 (Ellipse), e = 1 (Parabola), e > 1 (Hyperbolic escape).

2. Law of Equal Areas
dA / dt = L / (2m) = constant

A line segment joining a planet and the Sun sweeps out equal areas during equal intervals of time. Because gravity is a strictly central force, angular momentum L = m (r × v) is conserved. A planet travels fastest at perihelion (closest) and slowest at aphelion (furthest).

3. Law of Harmonies
T2 / a3 = 4π2 / (G(M + m))

The square of a planet's orbital period T is directly proportional to the cube of the semi-major axis a of its orbit. For planets in our Solar System where mMSun, the ratio T2 / a3 is virtually identical for every planet.

The Vis-Viva Equation & Orbital Velocity Bounds
Vis-Viva Equation ("Living Force")
v2 = GM (2/r − 1/a)

Derived directly from the conservation of specific mechanical energy: ε = v2 / 2 − GM / r = −GM / (2a).

  • Elliptical Bound Orbits (a > 0, ε < 0): Planet remains gravitationally captured.
  • Parabolic Trajectory (a → ∞, ε = 0): Marginally unbound escape path.
  • Hyperbolic Flyby (a < 0, ε > 0): Unbound trajectory with excess hyperbolic velocity at infinity.
Circular & Escape Velocities
vcirc = √(GM / r)
vesc = √(2GM / r) = √2 • vcirc ≈ 1.414 vcirc

To maintain a circular orbit at radius r, the gravitational attraction must exactly equal the required centripetal acceleration v2 / r = GM / r2. If a spacecraft boosts its speed by just 41.4% (√2), its kinetic energy completely overcomes gravitational potential energy, enabling it to escape into interplanetary space.

Astrodynamic Maneuvers & Lagrange Equilibrium Points
Hohmann Orbital Transfer Maneuver

The most fuel-efficient two-impulse orbital transfer between two coplanar circular orbits of radius r1 and r2:

atx = (r1 + r2) / 2
Δv1 = √(GM / r1) • (√(2r2 / (r1 + r2)) − 1)
Δv2 = √(GM / r2) • (1 − √(2r1 / (r1 + r2)))

The transfer orbit is tangent to the inner orbit at periapsis and tangent to the outer orbit at apoapsis, minimizing propulsive propellant expenditure (Δv).

Lagrange Points (L1 to L5)

Five equilibrium positions in the circular restricted three-body problem where gravitational pull and centrifugal force balance:

  • Collinear Points (L1, L2, L3): Lie on the line joining the two primary masses. Unstable saddle equilibria (home to space telescopes like JWST at Sun-Earth L2 and SOHO at L1).
  • Equilateral Points (L4, L5): Form equilateral triangles 60° ahead of and behind the secondary body. Dynamically stabilized by the Coriolis force when mass ratio M1 / M2 > 24.96 (hosting Trojan asteroids).