Software Engineer
Loading posts...
Feel free to contact me at kanishksachdev@gmail.com
Two bodies pulling on each other by gravity trace clean, predictable ellipses; Newton solved that in the 1680s. Add a third and the problem becomes famously unsolvable in closed form: the motion turns chaotic, where a hair's difference in starting conditions sends everything down a completely different path.
Below, every dot pulls on every other dot with Newtonian gravity. Pick a preset, then drag bodies around and fling them into new orbits to feel how delicate the balance is.
Drag a body to reposition it, or fling it to give it a new velocity.
0 bodies. Tap one to change its mass or pin it in place; drag to fling it into a new orbit.
Every frame, the force on each body is the sum of Newton's inverse-square pull from all the others (F = G·m₁·m₂ / r²). The catch is turning those forces into motion accurately. A naive step (move by velocity, nudge velocity by force, repeat) slowly leaks energy, and orbits spiral apart within seconds.
Try the triple preset and reset it a few times: same setup, wildly different fates. That sensitivity is the n-body problem in a nutshell.