Show HN: Browser-based interactive 3D Three-Body problem simulator
Inspiration and Overall Reception
- Many commenters praise the simulator as “lovely,” “beautiful,” and surprisingly smooth for a browser app, with particular appreciation for the 3D presets and rich controls.
- The URL and concept are explicitly tied to the “Three-Body Problem” novels; several people connect the sim to moments in the books or TV show, with mixed opinions on the accuracy/quality of the fiction.
- Some plan to let kids play with it or use it as an educational tool.
Implementation, Integrators, and Performance
- The sim uses Newtonian gravity with selectable ODE solvers (Velocity Verlet, RK4). Defaults are fixed time steps plus a “softening” factor to avoid singularities when bodies get very close.
- Discussion suggests adding adaptive step sizes and symplectic integrators for long‑term accuracy; links are shared to academic references and other 2D/3D n‑body demos.
- Suggestions include:
- Presets for real systems (e.g., Alpha Centauri, Earth–Moon–Sun, Painlevé configuration).
- Visualizations of total momentum and escape energy.
- A perturb button (currently achievable by pausing and tweaking mass/positions).
- Handling close approaches via merging/tearing bodies, rather than letting forces explode.
- Implementation details like using Three.js Line2 for thick trails, potential web workers, and an anaglyph (red/cyan) 3D mode are discussed; the author rapidly fixes small bugs (camera lock after pause, anaglyph behavior).
Chaos, Stability, and Physics Discussion
- Several comments clarify that:
- Three‑body systems are deterministic but chaotic: highly sensitive to initial conditions, no general closed‑form solution.
- There are special periodic orbits; these can appear stable for a while but often are unstable to perturbations. The demo’s initial “stable” configuration eventually diverges due to numerical error.
- Sundman’s analytical series solution exists but converges so slowly it’s useless in practice.
- Numerical solvers with finite precision necessarily diverge from the “true” trajectory over time.
- Debate arises over “stability” in real systems (e.g., Earth–Moon–Sun, moons, Lagrange points, KAM theorem), and over misconceptions connecting n‑body ejections with the Big Bang.
- Users note how frequently bodies are ejected in the sim and how it reveals intuitions like: after a slingshot, the remaining binary’s barycenter itself moves through space.
LLMs and “Vibecoding”
- One thread asks if this was “made with Gemini 3.” Responses note that the physics are standard numerical ODE integration, but the code can be “vibe‑coded” with LLMs.
- The author confirms using Claude Code to bootstrap the project, then refining it.
- Others reference Google’s Gemini 3 demo of a three‑body simulation UI.