Two celestial bodies interacting gravitationally can establish a stable system in which both trace out elliptical (or possibly circular) orbits about their mutual barycenter (center of mass), marked with a red dot. Each orbit individually follows Kepler's three laws of planetary motion.
Kepler's first law specifies that each orbit is an ellipse with one focus at the barycenter.
According to Kepler's second law, each orbit sweeps out equal areas in equal times. Thus for an eccentric orbit, the speed increases closer to the barycenter.
Kepler's third law states that the square of the period of an orbit is proportional to the cube of its semimajor axis. Accordingly, the outer planets of the Solar System have much longer "years" than Earth.
When one of the interacting bodies is much more massive than the other, as in the typical case of a planet orbiting a star, the more elementary form of Kepler's laws pertains, with the star itself at the focus of an elliptical orbit. Actually, the barycenter is then located within the body of the star, but not at its exact center. This can cause the star to "wobble" when a Jupiter-sized planet orbits around it. In recent years, the existence of extrasolar planets has been detected in this way.
In this Demonstration, you can vary the mass ratio and the eccentricity ϵ of the orbit. For a circular orbit,
, while for an ellipse
. You can adjust the apoapses, the vectors from the barycenter to the farthest point of each orbit, also known as Laplace–Runge–Lenz vectors. (Apogee, aphelion, and apoastron are more familiar synonyms for apoapsis pertaining to specific celestial bodies.) Rotating the three-dimensional figure can show the orbits from different angles. From an edge-on perspective, the motions of the orbiting bodies appear to follow irregular linear trajectories.