3D Moon Explorer · NASA LROC color
Shackleton, Chang'e 6,
88°48'S 123°24'E, or 42S 206E
Luna Maps is a browser 3-D Moon explorer. The globe, satellite, Earth, Sun and orbits are rendered and animated in real time; the orbital motion is computed from the physics below, not canned animation.
app.js; the
GRAIL coefficients in grail_gravity.js.With every perturbation off, the satellite follows a closed Keplerian ellipse about the Moon. Position comes from the six classical elements (a, e, i, Ω, ω, ν):
r = a(1 − e²) / (1 + e·cos ν)
The true anomaly advances at the physical rate (faster at periapsis), where n = √(μ/a³) is the mean motion:
dν/dt = n · (1 + e·cos ν)² / (1 − e²)^(3/2)
Orbital period from Kepler's third law:
T = 2π · √(a³ / μ)
Moon gravitational parameter μ = GM = 4902.8 km³/s²; lunar radius R = 1737.4 km, so altitude = a − R (circular case).
Enabling any perturbation switches to a numerical integrator (4th-order Runge–Kutta) seeded from the current Keplerian state. It propagates the equation of motion in a Moon-centred frame:
r̈ = −μ·r/|r|³ + Σ μ_b·( (s_b−r)/|s_b−r|³ − s_b/|s_b|³ )
The bracketed third-body term is the standard "direct minus indirect" form: the body's pull on the satellite minus its pull on the Moon (the frame origin). s_b is each body's position from the Moon, taken from the live ephemeris, so the orbit genuinely precesses and deforms over time. Constants: μ_Earth = 398600.44 km³/s², μ_Sun = 1.327×10¹¹ km³/s².
With "GRAIL gravity map" on, the Moon is no longer a point mass. Its potential is expanded in spherical harmonics using NASA's GRAIL model GRGM1200A (fully-normalized coefficients, truncated to the selected degree, max 18):
U = (μ/r) Σₙ Σₘ (R/r)ⁿ P̄ₙₘ(sin φ) (C̄ₙₘ cos mλ + S̄ₙₘ sin mλ)
R = 1738.0 km is the model's reference radius, φ/λ the Moon-fixed latitude/longitude. The acceleration −∇U is evaluated with the Cunningham V/W recursion (Montenbruck & Gill). The largest terms are the oblateness C̄₂₀ ≈ −9.09×10⁻⁵ and the equatorial bulge C̄₂₂ ≈ 3.47×10⁻⁵; higher degrees add the large basin mascons that make many low lunar orbits unstable.
Because the field is fixed to the surface, the perturbed orbit is integrated in the rotating Moon-fixed frame (spin period 27.32 days), adding Coriolis and centrifugal terms:
a_rot = a_grav − 2ω×v − ω×(ω×r)
So the orbit plane slowly turns relative to the surface (~13.2°/day). The integration stops if the orbit decays into the surface.
The Sun direction (lighting / phase) and the Earth–Moon geometry use low-precision analytic series for the Sun's and Moon's geocentric ecliptic longitude/latitude (Schlyter's method), accurate to a fraction of a degree — enough to drive the terminator and third-body directions from the chosen date and time.
L2 sits beyond the far side at a distance from the Moon of
d_L2 ≈ R_EM · ∛(m_moon / 3·m_earth)
where R_EM is the Earth–Moon distance. The satellite traces an idealised 3-D halo (parametric Lissajous-style loop) about that point at the nominal ~14.8-day period. This path is illustrative and is not integrated from gravity.
Ground sample distance (metres per pixel) for a sensor of height H with pixel pitch p (so N = H/p pixels span the field) at slant range to the surface:
GSD = range · 2·tan(FOV/2) / N
Surface coverage is the spherical cap the camera sees, bounded by the field of view and the horizon. With d = R + h and γ = FOV/2, the cap half-angle is
β = asin((d/R)·sin γ) − γ, capped at α = arccos(R/d)
and the fraction of the whole Moon in view is (1 − cos β) / 2.
Models are simplified for interactive visualisation. The ephemeris is low-precision, the gravity map is truncated to degree 18, L2 is idealised, and the camera figures assume a nadir-pointing circular footprint — treat the numbers as educational estimates, not mission-grade values.