In the Ptolemaic system of astronomy, the epicycle (literally: on the circle in Greek) was a geometric model used to explain the variations in speed and direction of the apparent motion of the Moon, Sun, and planets. It was designed by Apollonius of Perga at the end of the 3rd century BC. In particular it explained the retrograde motion of the five planets known at the time. Secondarily, it also explained changes in the apparent distances of the planets from Earth.
In the Ptolemaic system, 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 eastward and are roughly parallel to the plane of the Sun's orbit (ecliptic). The orbits of planets in this system are epitrochoids.
The deferent was a circle centered around a point halfway between the equant and the earth. The epicycle rotated on the deferent with uniform motion, not with respect to the center, but with respect to the off-center point called the equant. The rate at which the planet moved on the epicycle was fixed such that the angle between the center of the epicycle and the planet was the same as the angle between the earth and the sun.
Ptolemy did not predict the relative sizes of the planetary deferents in the Almagest. All of his calculations were done with respect to a normalized deferent. This is not to say that he believed the planets were all equidistant. He did guess at an ordering of the planets. Later he calculated their distances in the Planetary Hypotheses.
For superior planets the planet would typically rotate in the night sky slower than the stars. Each night the planet would "lag" a little behind the star. This is prograde motion. Occasionally, near opposition, the planet would appear to rotate in the night sky faster than the stars. This is retrograde motion. Ptolemy's model, in part, sought to explain this behavior.
The inferior planets were always observed to be near the sun, appearing only shortly before sunrise or shortly after sunset. To accommodate this, Ptolemy's model fixed the motion of Mercury and Venus so that the line from the equant point to the center of the epicycle was always parallel to the earth-sun line.
This idea may have been started by Copernicus' claims that he used less circles than his predecessors. However, in reality, geocentric theories in use at the time of Copernicus used just a few more circles than Copernicus theory (all the circles with a period of one year), and all theories showed good agreement with observations. Though Copernican calculations showed better agreement, the imporovement was marginal. Unfortunately, this can be checked only by going back to the original sources, the works of Copernicus and of the medieval astronomers.
Most commonly the number of circles is given as 80 for Ptolemy, versus a mere 34 for Copernicus. The highest number appeared in the Encyclopaedia Britannica on "Astronomy" during the 1960s, in a discussion of King Alfonso X of Castile's interest in astronomy during the 13th century. (Among his other activities, Alfonso is supposed to have commissioned the Alfonsine Tables.)
The difficulty with this account is that historians examining books on Ptolemaic astronomy from the Middle Ages and the Renaissance have not found any trace of multiple epicycles being used for each planet. The Alfonsine Tables, for instance, were actually closer to Ptolemy's original calculations than the older Tables of Toledo, while 16th-century books based on Ptolemy and Copernicus use about equal numbers of epicycles. The idea that Copernicus used only 34 circles in his system comes from his own statement in a preliminary unpublished sketch called the Commentariolus. By the time he published De revolutionibus orbium coelestium, he had added more circles. Counting the total number is difficult, but estimates are that he created a system just as complicated, or even more so. The popular total of about 80 circles for the Ptolemaic system seems to have appeared in 1898. It may have been inspired by the non-Ptolemaic system of Girolamo Fracastoro, who used either 77 or 79 orbs in his system inspired by Eudoxus of Cnidus. The first planetary model without any epicycles was that of Ibn Bajjah (Avempace) in 12th century Andalusian Spain, but epicycles were not eliminated in Europe until the 17th century, when Johannes Kepler's model of elliptical orbits gradually replaced Copernicus' model based on perfect circles.