In the Hipparchian, Ptolemaic, and Copernican systems of astronomy, the epicycle (from Ancient Greek ἐπίκυκλος (epíkuklos) 'upon 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 the 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 2nd century BC, then formalized and extensively used by Ptolemy in his 2nd century AD astronomical treatise the Almagest.