Visualizations
338 / 500

338 · Astronomy

Ringmaker

Backlit planetary rings with shepherd moons, wavy gap edges, propellers and waves.

Sixty thousand ring particles orbit in Hill's local frame, a small box that co-orbits with a moonlet, so material inside its orbit streams one way and material outside streams the other (Keplerian shear). The undisturbed epicycles are advanced with their exact closed form, and only the kicks from a few moons are integrated, so the shear never smears. Particles that pass the moonlet pick up epicycles whose phase winds with the shear, and its gap edges ripple with a wavelength of 3 pi times the distance (the Keeler gap look). Two shepherds sweep past a narrow braided ringlet, a small moonlet stirs a propeller, and density waves follow the WKB streamline solution, crests crowding tighter away from the resonance. Collisions damp each particle's epicycle, stirred particles shed dust and glow brighter, and the density is averaged over frames while sliding with the shear, blurred along the orbit, tone mapped in a pastel, forward-scattered palette and resampled into an oblique view of the ring plane.

Try it. Drag any moon anywhere and watch its lane respond. Press and hold on the ring to grow a new moonlet (up to four), which carves its own gap with propeller wakes. Up and down arrows change the speed, Backspace removes your last moonlet, L toggles labels and R resets.

  • Hill's equations in a shearing sheet
  • Exact epicycle integration
  • WKB density wave streamlines
  • Anisotropic density splatting

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a close-up of a planet's rings, with a small moon keeping a gap open, using JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Simulate a small patch of the rings in Hill's local frame, which orbits along with a moonlet sitting at the origin. x is the distance outward from the moonlet's orbit (draw it upward), y is the distance along the orbit (draw it sideways, and wrap it around the screen edges). Use units where the orbital angular speed is 1.
- Scatter about 20,000 particles at random x and y, skipping a band around x = 0. Give each one the velocity vy = -1.5 * x so it moves with the shear: inner material drifts one way, outer material the other.
- Each step, apply Hill's equations: ax = 2 * vy + 3 * x and ay = -2 * vx, plus the moonlet's gravity GM * (dx, dy) / r^3 with a little softening. Remove particles that hit the moonlet and respawn them elsewhere.
- Draw every particle as a faint dot and watch ripples form along the gap edges downstream of the moonlet.

Once that works, make it beautiful:
- Instead of dots, add each particle into a low-resolution density grid, blur it more along the orbit than across it, and map density to a soft pastel color, like rings seen with the Sun behind them.
- Give the starting density a barcode of thin ringlets and gaps, so the moon's wakes visibly bend them.
- Damp each particle's wobble a little every step (collisions), and let the pointer drag the moonlet to a new radius.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as two shepherd moons around a narrow ringlet, spiral density waves at a resonance, or advancing the unperturbed epicycles with their exact solution so the shear never smears.
PreviousForest of LightTrees grow by competing for light in a watercolor forest that turns with the seasons. NextPhase MusicTwo players loop one figure, one slightly faster, printing a moire record of the drift.

Related visualizations

  • ChirpPhysics Two black holes spiral together and ring spacetime, from post-Newtonian formulas.
  • Coffee RingFluids Coffee drops dry into dark rings, beside two tricks that make them dry evenly.
  • Kirkwood GapsAstronomy Thousands of asteroids and Jupiter's resonances carving gaps into a featureless belt.
  • Orbital ResonanceAstronomy A seven-planet resonant chain that chimes on every transit and weaves its own spirograph.
  • Dark Matter CurveAstronomy Switch off the dark halo and watch a spiral galaxy fly apart.
  • Planet ForgeAstronomy A dusty disk grows rocky worlds, ice giants and gas giants by N-body accretion.
  • Kelvin-Helmholtz BillowsFluids A sunset sky where sliding air layers roll a cloud deck into breaking-wave billows.
  • Ocean3D Rolling waves at sunset, built from layered Gerstner waves.
  • Euclidean RhythmsSound Risograph bead rings play world rhythms made by a neutron accelerator timing algorithm.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs