N-Body Gravity Simulator

Mechanics Advanced Free
N-Body Gravity Simulator – Mechanics
N-Body Gravity Simulator – Mechanics

Two bodies orbit predictably; three or more generally do not. This simulator lets you place any number of masses, give them initial velocities and watch the gravitational interactions play out, including slingshots, captures and ejections.

How to use this simulation

What to look for

The physics behind it

Every pair of masses attracts with F = Gm₁m₂/r², and the net force on each body is the vector sum of all the others. Two-body orbits are exact conic sections, but from three bodies onwards there is no general closed-form solution — the motion has to be computed step by step and is often chaotic.

gravityn-bodyorbitssimulation