HN Debrief

Show HN: Gravity – interactive solar-system simulator, from Newton to Einstein

  • Science
  • Programming
  • Developer Tools
  • Education

The post is a weekend-built interactive simulator for explaining why orbits exist, not just showing planets circling. It walks from Newtonian ideas like equal and opposite force, inertia, and "falling but always missing" into real solar-system data, a toggleable N-body integrator, and finally a visual introduction to Einstein’s curved spacetime. The author says the physics runs in real units, with only the display scale remapped so planets are visible, and that the whole thing is client-side in TypeScript and Three.js.

If you build educational sims, expect users to stress-test both the UI and the underlying model. The fastest way to earn trust is to label approximations clearly, separate conceptual visuals from actual simulation code, and patch obvious inaccuracies quickly.

Discussion mood

Positive and constructive. People liked the simulator’s clarity, speed, and educational intent, but many immediately started auditing the physics and visuals for places where a beginner could walk away with the wrong model.

Key insights

  1. 01

    Einstein slide needs a cleaner boundary

    The simulator’s relativity section works as a visual metaphor, but it muddies the relationship between Newtonian gravity and general relativity. Newtonian gravity is the weak-field, low-speed limit of Einstein’s theory, not a separate rival model, and the current handoff makes that continuity harder to see. That matters more because the author confirmed the N-body code is still purely Newtonian, with no post-Newtonian correction such as Mercury’s perihelion precession.

    If you present multiple physics models in one product, mark exactly where the math changes and where it does not. A simple label like "conceptual visualization" versus "simulated dynamics" would prevent most of this confusion.

      Attribution:
    • rfgplk #1
    • qunabu #1
  2. 02

    Seasons animation risks teaching axial precession

    The day-and-seasons section appears to animate Earth’s axis in a way that looks like precession, even though the intended concept is axial parallelism. Over the span of a year, the axis should stay pointed in nearly the same direction in space, which is why the tilt toward or away from the Sun changes with Earth’s position in orbit. Precession is real, but it happens over roughly 26,000 years, so showing it in a one-day or one-year context plants the wrong idea.

    When teaching astronomy, animation choices can be more misleading than text. Review any motion you add for visual appeal and ask whether it implies a physical timescale you did not mean to show.

      Attribution:
    • jrflo #1
    • savoyard #1
    • BigTuna #1
  3. 03

    Orbit demos should show a range of stable speeds

    The explanation leans too hard on the neat beginner story that there is one magic speed for orbit, slower means crash and faster means escape. That is only true at a given radius for a circular orbit. In practice, speeding up often gives you a larger ellipse and slowing down gives you a smaller one. Commenters pointed out that falling into the Sun from Earth’s orbit is especially hard because you first have to cancel a huge sideways velocity of about 30 kilometers per second.

    If you teach orbital mechanics, show circular, elliptical, and escape cases side by side. That gives learners a model they can actually use for spacecraft intuition instead of a binary crash-or-fly-away picture.

      Attribution:
    • SamBam #1
    • nonethewiser #1
  4. 04

    REBOUND is the benchmark for real N-body work

    For readers who want to go beyond an educational demo, REBOUND came up as a production-grade N-body package used in planetary formation research. The point was not that the Show HN should use it, but that there is a well-known reference implementation for people who want stronger numerics, standard integrators, and examples that connect toy simulations to scientific practice.

    If this project grows past education into analysis, compare its outputs against REBOUND early. That gives you a sanity check on integrator behavior before you add more features.

      Attribution:
    • kmaitreys #1
  5. 05

    Tiny perturbations dominate over long timescales

    A useful reminder from orbital mechanics practitioners was that the clean Kepler picture is only the starting point. Real trajectories need perturbation calculations because every body influences every other body, and small effects accumulate over huge distances and long time spans. That is why hand-derived ephemerides were so demanding and why even the solar system is not perfectly, forever stable.

    Treat long-run orbital accuracy as a different problem from short-run visualization. Once you move from teaching intuition to forecasting trajectories, perturbations and numerical error control become first-class features.

      Attribution:
    • TheOtherHobbes #1

Against the grain

  1. 01

    The 3D helix view is unusually accurate

    Most attention went to mistakes, but one reader called out that the solar-system-through-space view avoids the viral "vortex" animation that wrongly turns planetary motion into a trailing spiral. Showing the planets as a helix relative to the Sun’s motion is a rare place where the project is more correct than popular science content people may already have seen.

    Keep this section and consider explaining explicitly why the older vortex animation is wrong. It is a chance to replace a common internet misconception with a better mental picture.

      Attribution:
    • jumploops #1

In plain english

axial parallelism
The fact that Earth’s rotation axis stays pointed in nearly the same direction in space as Earth orbits the Sun.
ephemerides
Tables or computed datasets giving the predicted positions of astronomical objects over time.
N-body
A simulation that computes how multiple objects move under each other’s gravity instead of assuming simple fixed orbits.
perihelion precession
The gradual rotation of an orbit’s closest-approach point over time.
post-Newtonian
A set of correction terms added to Newtonian gravity to approximate relativistic effects when full general relativity is unnecessary.
Three.js
A JavaScript library for rendering interactive 3D graphics in a web browser.

Reference links

Simulation and code references

  • Gravity source code
    Source repository for the simulator shown in the post.
  • REBOUND
    Suggested as a more rigorous N-body simulation package used in planetary formation research.

Visualization references

Astronomy learning resources

Orbital mechanics references