This n-body gravity simulator is a project I released on 14 May 2020. It allows the user to spawn particles with mass and velocity and uses a simple algorithm which implements Newton's Law of Universal Gravitation, calculating and applying the gravitational forces between every object. While this method results in an inefficient n(n-1) time complexity, it also presents the most accurate result. Algorithms that would run the simulation faster, such as Barnes-Hut, use approximations which decrease the accuracy of the simulation.

The simulator uses a gravitational constant of 0.06674 and a particle diameter equal to the eighth root of the mass.

Click on the banner image or the following link to view this program's itch.io page: n-Body Gravity Simulator

Features

Controls

KEY ACTION
WASD Scroll Camera
Scroll Wheel Zoom In or Out
Click Spawn Object
Click and Drag Spawn Object with Velocity
Escape Menu
Groups of mass-bodies gravitationally clumped together. Trinary Gravitational System Two large mass-bodies orbit one-another.