N-Body Orbit Sandbox

Create your own universe and watch the laws of gravity unfold.

The Force of Gravity

This simulation models Newton's Law of Universal Gravitation: $F = G \frac{m_1 m_2}{r^2}$. This formula describes the attractive force ($F$) between any two objects. The force is stronger for objects with more mass ($m_1, m_2$) and gets significantly weaker as the distance ($r$) between them increases. This continuous force is what pulls objects into orbit.

Energy in an Orbit

  • The work done by gravity gives the system stored Potential Energy (GPE). As objects get closer, GPE decreases (becomes more negative).
  • This lost GPE is converted into Kinetic Energy (KE), the energy of motion, making the objects move faster.
  • Because gravity is a "conservative" force, the Total System Energy (KE + GPE) remains constant!

Controls

System Status

Number of Bodies: 0

Total Mass: 0

Kinetic Energy (KE): 0 J

Potential Energy (GPE): 0 J

Total Energy (KE+GPE):
0 J