Gravity Sandbox

N-body gravity: place masses and watch mutual attraction evolve. Good for intuition about Lagrange-like balance, slingshots, and instability in multi-body systems.

Who it's for: Astrophysics curious learners; conceptual N-body play (not a mission planner).

Key terms

  • N-body
  • gravity
  • superposition
  • orbital mechanics

How it works

A playful N-body sandbox: every mass attracts every other mass with Newton’s law, softened slightly (ε) so close encounters stay numerically stable. Drag a body to pin it; release to let gravity take over again. When two bodies overlap, they merge — mass and momentum combine. Start with the built-in binary or clear and place your own stars. This is a qualitative toy, not a solar-system ephemeris.

Key equations

aᵢ = Σⱼ G mⱼ (rⱼ − rᵢ) / (|rⱼ − rᵢ|² + ε²)^1.5
Velocity Verlet integration (symplectic-ish)