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 |
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.
| 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
Illustrative scale enlarges bodies and spreads close moons so they can be seen; real scale uses physical sizes and distances. Lighting, textures, spin from the IAU poles, Saturn's rings and trails are presentation only: they never feed the physics, the inspector or the CSV export.
Controls
The simulator's dock has play, speed, date and scene; Find, View, Keys and Data open small panels. With the view focused: Space pause, N step, R restart, [ ] speed, F B frame, V scale, G grid, H labels. Natively, K cycles scenes and 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); fonts Cormorant Garamond and JetBrains Mono (OFL). Usage analytics run only on the deployed site, and only when configured. Source on GitHub.