This simulation models the gravitational interactions between celestial bodies according to Newton's law of universal gravitation:
F = G * (m₁ * m₂) / r²
.
Each body attracts every other body with a force proportional to the product of their masses and inversely proportional to the square
of the distance between their centers.
Use the controls to adjust the simulation speed and the strength of gravity. Add planets, modify their masses, initial positions (by resetting and adjusting initial state in code if needed), and velocities to create stable orbits, binary systems, or chaotic interactions.
Try creating: