Sacard Physic Engine is small physic engine which can simulate the gravitation of multiple celestial bodies. This is a 3D version of the original app: Sacard-Gline
I recommentd to use the the original 2D app. It's limited by a 2D world but it have a better documentation.