In the Hipparchian and Ptolemaic systems of astronomy, the epicycle (from Ancient Greek: ἐπίκυκλος, literally on the circle, meaning circle moving on another circle) was a geometric model used to explain the variations in speed and direction of the apparent motion of the Moon, Sun, and planets. In particular it explained the apparent retrograde motion of the five planets known at the time. Secondarily, it also explained changes in the apparent distances of the planets from Earth.
It was first proposed by Apollonius of Perga at the end of the 3rd century BC. It was developed by Apollonius of Perga and Hipparchus of Rhodes, who used it extensively, during the second century BC, then formalized and extensively used by Ptolemy of Thebaid in his 2nd-century AD astronomical treatise the Almagest.
Epicyclical motion is used in the Antikythera mechanism, an ancient Greek astronomical device for compensating for the elliptical orbit of the Moon, moving faster at perigee and slower at apogee than circular orbits would, using four gears, two of them engaged in an eccentric way that quite closely approximates Kepler's second law.
In both Hipparchian and Ptolemaic systems, the planets are assumed to move in a small circle called an epicycle, which in turn moves along a larger circle called a deferent. Both circles rotate clockwise and are roughly parallel to the plane of the Sun's orbit (ecliptic). Despite the fact that the system is considered geocentric, each planet's motion was not centered on the Earth but at a point slightly away from Earth called the eccentric. The orbits of planets in this system are similar to epitrochoids.