Gravity Sandbox
Interactive simulation — adjust parameters and watch the visualization update in real time.
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)