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")[1] 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.
Epicyclical motion is used in the Antikythera mechanism, [citation requested] 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.
Epicycles worked very well and were highly accurate, because, as Fourier analysis later showed, any smooth curve can be approximated to arbitrary accuracy with a sufficient number of epicycles. However, they fell out of favor with the discovery that planetary motions were largely elliptical from a heliocentric frame of reference, which led to the discovery that gravity obeying a simple inverse square law could better explain all planetary motions.