How the math works

From your clock to a point on the screen, in seven steps

Nothing is looked up from a service. Each step below is code in this site, taken from a published source and tested against published values. The panel under the steps follows one real number all the way through: how far Jupiter is from Earth at this minute.

  1. 1

    Your clock

    The device’s time in UTC, with leap seconds counted, turned into a Julian day.

    JD = 2440587.5 + ms / 86 400 000

    Meeus, Astronomical Algorithms, ch. 7

    exact

  2. 2

    Physics time

    Earth’s spin is irregular, so the orbits run on Terrestrial Time. ΔT is the gap between the two.

    TT = UT + ΔT

    Espenak & Meeus 2006 · IERS leap seconds

    ± 0.0 s at this moment

  3. 3

    Planet orbits

    Each planet’s position is a sum of thousands of periodic terms in time T.

    L = Σ Tⁿ Σ A cos(B + C·T)

    VSOP87D, Bretagnon & Francou 1988

    within 4,600 km of JPL for every planet

  4. 4

    The Moon

    The Moon has its own theory, with the Sun’s and planets’ pulls as series terms.

    λ = L′ + Σ ℓᵢ sin(D, M, M′, F)

    ELP2000-82, as given in Meeus ch. 47

    within 35 km of JPL

  5. 5

    Earth’s wobble

    Precession and nutation turn the sky of J2000 into the sky of the day.

    Δψ = Σ (Sᵢ + S′ᵢT) sin(argᵢ)

    IAU 1980 nutation (Meeus ch. 22), Lieske 1977 precession

    low-precision series

  6. 6

    Spin and shadows

    IAU poles and prime meridians turn each globe. Besselian elements put each eclipse shadow on Earth.

    W = W₀ + Ẇ·d

    IAU WGCCRE · Besselian elements

    eclipses within 45 s of NASA’s canon, 1900–3000

  7. 7

    To the screen

    True kilometres in double precision, moved next to the camera so nothing jitters at 30 AU, then drawn by three.js.

    p_gpu = float(p − camera)

    Floating origin, logarithmic depth

    the physics is unchanged