This project enables us to simulate gravitational forces and apply them to objects with a certain mass. It calculates the forces of n-body objects and their interactions, it can be used to see simulate the Solar System conditions. The gravity simulator could have educational porpuses.
Using a real-time force calculation we avoid the n-body problem and it does not matter how many objects we introduce in the scene. We have also implemented a static positioning that is used because if we give a certain velocity to a body, applying the first Newton ‘s Law, our system would probably experience a uniform linear movement.
It can be also used to demonstrate the Second and Third Newton’s Laws. Elliptical orbits are common, although if we set a huge initial velocity, our body will not be trapped by our center of mass.
Gravitational force ():
Gravitational potential energy ():