Gravitation-Engine is a project mainly written in C, it's free.
Engine designed to simulate the gravitational interactions between a set of bodies
Gravitation Engine
An API to be used with other projects that will approximate the relations between massive objects in a 3D space.
Credits