3D Animate Moon's Orbit
Interactive 3D visualization of the Moon orbiting Earth with real astronomical data, Kepler orbital mechanics, and phase display.
About
The Moon follows an elliptical path around Earth with a semi-major axis of 384,400 km and eccentricity e = 0.0549. This simulation solves Kepler's equation iteratively to compute the true anomaly ν from mean anomaly M, producing accurate positional data at any simulation time. Orbital inclination of 5.145° relative to the ecliptic plane is modeled, causing the apparent vertical oscillation visible in the 3D view. Ignoring these parameters leads to incorrect eclipse predictions and tidal calculations.
The visualization renders Earth-Moon distance in real-time, ranging from perigee (356,500 km) to apogee (406,700 km). Moon phase is computed geometrically from the Sun-Earth-Moon angle, assuming a fixed Sun direction along the positive X-axis. This tool approximates a two-body problem; perturbations from the Sun and planets are not included. Pro tip: observe how distance varies as the Moon traverses its ellipse - closest approach occurs at the orbit's rightmost point (perigee).
Formulas
The radial distance r of the Moon from Earth at true anomaly ν follows the polar equation for an ellipse:
Where a = semi-major axis, e = eccentricity, ν = true anomaly (angle from perigee).
To find ν from time, we first compute mean anomaly M then solve Kepler's equation for eccentric anomaly E:
This transcendental equation is solved via Newton-Raphson iteration:
True anomaly is then derived from eccentric anomaly:
3D Cartesian coordinates in the orbital plane are computed as:
Where i = 5.145° is orbital inclination. Perspective projection onto 2D canvas uses focal length f:
Where d = camera distance from origin.
Reference Data
| Parameter | Symbol | Value | Unit |
|---|---|---|---|
| Semi-major Axis | a | 384,400 | km |
| Eccentricity | e | 0.0549 | - |
| Orbital Period (Sidereal) | T | 27.322 | days |
| Orbital Period (Synodic) | Tsyn | 29.530 | days |
| Inclination to Ecliptic | i | 5.145 | ° |
| Mean Orbital Velocity | v | 1.022 | km/s |
| Perigee Distance | rmin | 356,500 | km |
| Apogee Distance | rmax | 406,700 | km |
| Moon Radius | RMoon | 1,737.4 | km |
| Earth Radius | REarth | 6,371 | km |
| Argument of Perigee | ω | 318.15 | ° |
| Longitude of Ascending Node | Ω | 125.08 | ° |
| Mean Angular Motion | n | 13.176 | °/day |
| Escape Velocity (Moon) | vesc | 2.38 | km/s |
| Surface Gravity (Moon) | g | 1.62 | m/s2 |
| Mass Ratio (Moon/Earth) | μ | 0.0123 | - |
| Hill Sphere Radius | rH | 61,500 | km |
| Orbital Energy | E | −3.8 × 1028 | J |
| Angular Momentum | L | 2.88 × 1034 | kg⋅m2/s |
| Tidal Locking Ratio | - | 1:1 | - |