About
A C11 solar system you can inspect: the same physics runs natively with raylib, in the browser through WebAssembly, and in a command-line CSV runner.

Model
- State is SI: metres, kilograms, seconds, in double precision, in the J2000 ecliptic (simulation axes x, y, z = X, Z, −Y, so +y is ecliptic north).
- Gravity is Newtonian between point masses. Earth, Mars, Jupiter, Saturn, Uranus and Neptune add their J2 flattening for their own moons, and feel the reaction.
- Time advances in fixed 15-second velocity-Verlet steps. Faster playback runs more steps per frame, never longer ones; if a device falls behind, the achieved speed is shown.
- Every scene starts from the real sky of 2026-06-09, then follows only this model: a fixed Sun, no relativity, no tides, nothing outside the scene. It drifts from the real sky over time; it is not an ephemeris.
- The solar-system scene holds 32 large bodies. Each giant planet, Pluto, Didymos and Patroclus also has a scene with every catalogued moon (474 bodies in all).
- Moons with no published mass are test particles: they feel gravity but exert none. Unknown radii are shown as Unknown and drawn as wire markers.
- Checks: Phobos keeps its phase within 1° of the analytic orbit over 100 days; scenes agree within 1% with half-size steps; J2 reproduces the textbook nodal precession within 2%.
Data
| What | Source |
|---|---|
| Planet and Sun masses | GM / G: DE440 (Sun–Mars), planet-only Horizons GM (Jupiter–Pluto) |
| Starting positions | JPL Horizons vectors at JD 2461200.5 TDB (2026-06-09) |
| Moon elements | JPL planetary satellite mean elements |
| Moon masses and radii | JPL satellite physical parameters |
| J2 and equatorial radii | NASA Planetary Fact Sheets |
| Spin poles | IAU WGCCRE 2015 (Archinal et al. 2018) |
| Small bodies | JPL Small-Body Database snapshot |
| Didymos and Dimorphos | Horizons DART s547 reconstruction |
| Patroclus and Menoetius | Horizons asteroid-satellite solution JPL#82 |
| Textures | Solar System Scope, CC BY 4.0 |
| Constellation lines and bright stars | d3-celestial by Olaf Frohn, BSD 3-Clause |
| Uranus rings | NASA NSSDC Uranian Rings Fact Sheet |
| Neptune rings | NASA NSSDC Neptunian Rings Fact Sheet |
| Jupiter rings | NASA NSSDC Jupiter Rings Fact Sheet |
| Moon maps | USGS Astrogeology global mosaics, public domain |
| Relief | LRO LOLA (NASA SVS), MGS MOLA MEGDR (PDS), MESSENGER DEM (USGS), public domain |
Snapshots are pinned in data/ and checked offline on every build; refreshing them is an explicit, reviewed step. The small-body atlas holds 1,564,244 objects. Provenance and precision notes.
Code
Physics in src/sim/ never includes raylib; rendering in src/render/ reads physical state and never writes it.
Where each part lives and what checks it
| Part | Path | Checked by |
|---|---|---|
| Small-body atlas and source epoch | docs/public/catalog/ + data/planet_epoch.json | Offline tools/small_body_catalog.py --check and tools/planet_epoch.py --check; conic/experiment C tests and catalog-worker tests. |
| Giant-planet satellite catalogs | data/jovian_moons.json | Offline tools/satellite_catalog.py --check, C satellite/frame/period tests, and full-scene convergence. |
| Project spec | SPEC.md | Review before an implementation task; check drift after verification. |
| Simulation core | src/sim/ | make test-core covers initial states, orbital references, convergence, conservation, collisions, and source-catalog contracts without raylib. |
| Application helpers | src/app/ | C tests exercise reset/step, inspection, camera framing, 100-day accuracy, trail retention, descriptor validation, and comparison timing/identity. |
| Rendering boundary | src/render/ | Renderer helper tests guard scale conversion, visual radius policy, family framing, and grid sizing. |
| Runtime loop | src/main.c | Native and WebAssembly builds compile both loop targets; artifact checks validate generated files. |
| Headless and comparison entrypoints | src/headless.c + src/lab_web.c | make test-cli; tools/test_learning_wasm.mjs compares matching native/WASM experiments. |
| Test binaries | tests/ | make test test-build test-cli test-validators; make test-sanitize for address/undefined-behavior checks. |
| Public site | docs/ | npm test --prefix docs, npm run check --prefix docs, npm run build --prefix docs, and make docs-check; docs/browser-tests/ covers browser interaction. |
| Catalog and delivery tools | tools/ | make test-build test-validators, offline catalog checks, WASM checks, and make docs-check. |
| Browser runtime | docs/src/pages/index.astro | Runtime integration tests, generated route checks, and headless browser verification. |
| Automation | .github/workflows/ | Inspect Build/CodeQL for the revision and, on eligible main delivery, Deploy Pages plus the public runtime manifest. |
Rendering
Everything drawn is presentation: it reads the physical state and never feeds the physics, the inspector or the CSV export.

- Scale
- Illustrative enlarges bodies and pushes each moon out past its enlarged planet by the same amount, so moons keep their true order and spacing; real uses physical sizes and distances. Switching morphs between them.
- Orbit guides
- Each body's two-body ellipse about its parent, from its current position and velocity: where it would go if only its parent pulled on it.
- Trails
- The path each body actually took. Guide and trail separate slowly where other bodies perturb the orbit.
- Surfaces
- Planet maps by Solar System Scope; moon maps are USGS mosaics (maps without colour are tinted). The Moon, Mars and Mercury add relief from measured heights, exaggerated four times so it reads at the terminator. Every map turns on its IAU spin axis.
- Shadows
- Eclipses from the true geometry: they appear exactly when a moon's shadow really falls on its planet, or a planet's on a moon.
- Rings
- Saturn's from a map; Uranus's, Neptune's and Jupiter's from NASA ring tables, as faint as reality in real scale. Dusty rings glow when backlit.
- From Earth
- The camera at Earth's centre in real scale, aimed at the selection: true directions, phases and star backgrounds. Captions give the target's apparent disc, how much of it is lit (the Moon's or Venus's phase) and its angle from the Sun, which decides whether it is in a night sky. Dragging looks around the sky and Frame body re-centres; zooming narrows the field like a telescope, down to 72 arcseconds.
- Sky
- A real all-sky image turned to its true directions, with the 5,044 stars to magnitude 6 drawn as sharp points in their catalogue colours, and optional IAU constellation lines.
- Small bodies
- 48,074 asteroids, Trojans and Kuiper-belt objects sampled from the atlas, moved on their orbits around the Sun.
Controls
The dock has play, speed and scene; Tour visits every planet; Find, View, Keys and Data open small panels. Beside the clock, Today plays the sky forward to the present and Date to any instant up to 2076, both stopping within one 15-second step. The inspector reads the selected body from SI state, including its distance from Earth and how long its light takes to reach us. Keys work while the view has focus.
| To | Do |
|---|---|
| Turn, zoom | drag, scroll or pinch; two fingers twist |
| Share an instant | Date → Copy link: ?body=saturn&at=2027-03-23T12:00 opens on Saturn and plays to that instant (TDB); from the view from Earth it adds &from=earth&fov=0.05 |
| Name a body | point at it, or long-press on a phone |
| Go to a body | click it, its name, or the arrow at the edge for one out of view; / searches |
| Hop between bodies | ← → neighbours, ↑ parent, ↓ moons |
| Go back | Esc steps out, Backspace or the browser's Back retraces |
| Play | Space pause, N step, R restart, P run to the present (the Date button picks any instant), [ ] speed |
| Frame | F system, B body, V scale, Y follow an orbit, W view from Earth |
| Show | O orbits, T trails, Q asteroids, S constellations, G grid, H labels |
| Native app only | K cycles scenes, L lessons |
Build and tests
| Command | Does |
|---|---|
make / make run | build and run the native raylib app |
make test | C tests for physics, scenes, app and renderer helpers, plus offline data checks |
make test-sanitize | the same under address and undefined-behaviour sanitizers |
make headless | the solar-lab CSV runner (--scene, --catalog, --compare) |
make docs-assets | the WebAssembly build copied into this site |
npm run test:browser --prefix docs | browser journeys against the built site |
CI builds natively on Linux and macOS, builds WebAssembly, checks the site, runs CodeQL, and deploys the exact artifact it tested. SPEC.md records goals, invariants, tasks and bugs.
What's next
Every moon system with a JPL ephemeris now has a scene, most recently the Patroclus–Menoetius trojan binary. Moons of other asteroids have only literature orbits, so they wait for an ephemeris. Open work is tracked in SPEC.md.
Credits
Made by Jonathan Peris. Code under the MIT licence; data are transformed extracts of NASA/JPL products; textures by Solar System Scope (CC BY 4.0); moon maps from USGS Astrogeology mosaics of NASA, ESA and DLR data (public domain); relief from LRO LOLA, MGS MOLA and MESSENGER topography (NASA, USGS; public domain); constellation lines and the bright-star catalogue from d3-celestial, © 2015 Olaf Frohn, BSD 3-Clause (licence text in the source repository's assets/sky/); fonts Cormorant Garamond and JetBrains Mono (OFL). Usage analytics run only on the deployed site, and only when configured. Source on GitHub.