Orbits and Gravitational simulations using OpenGL and C.
Firstly, the program calculates the gravitational force between all the celestial bodies by using this formula:
by using this other formula, the force formula:
the program can get the acceleration of a body:
now, apply this acceleration to this movement equation: