Celestial mechanics is the branch of astronomy that deals with the motions and gravitational interactions of objects in outer space. Historically, celestial mechanics applies principles of physics (classical mechanics) to astronomical objects, such as stars and planets, to produce ephemeris data. The computation of the motion of the bodies through orbital mechanics can be simplified by using an appropriate inertial frame of reference. This leads to the use of various different coordinate systems, such as the Heliocentric (Sun-centered) coordinate system.
In a binary system of objects interacting through gravity, Newtonian mechanics can used to produce a set of orbital elements that will predict with reasonable accuracy the future position of the two bodies. This method demonstrates the correctness of Kepler's laws of planetary motion. Where one of the bodies is sufficiently massive, general relativity must be included to predict apsidal precession. The problem becomes more complicated when another body is added, creating a three-body problem that can not be solved exactly. Perturbation theory is used to find an approximate solution to this problem.