The same planetary motion in two coordinate systems: Sun-centered Kepler ellipses (left) and the Earth-centered deferent–epicycle construction (right).
Sun Earth Mars (elliptic model) epicycle-model position (dashed trace) × equant point
Each planet moves on an ellipse with the Sun at one focus. With mean anomaly \(M = 2\pi t/T\), we solve Kepler's equation \(M = E - e\sin E\) numerically and take \[ x = a(\cos E - e), \qquad y = a\sqrt{1-e^{2}}\,\sin E. \]
Seen from Earth, the planet is at \(\mathbf{r}_{p} - \mathbf{r}_{\oplus}\). If both orbits were circles, this is a sum of two uniform circular motions: \[ z(t) \;=\; a_{p}\,e^{i\omega_{p} t + i\lambda_p} \;-\; a_{\oplus}\,e^{i\omega_{\oplus} t + i\lambda_\oplus}, \qquad \omega = \tfrac{2\pi}{T}. \] The larger circle is the deferent, the smaller one the epicycle riding on it. Their combined motion produces the retrograde loops. The dashed trace (epicycle model) almost matches the solid trace (ellipse model); the gap is of order \(e\).
Ptolemy's fix for that gap: shift the deferent center away from Earth by \(ase\) and let the deferent point revolve uniformly about the equant point \(\times\) at distance \(2ase\), where \(s\) is the slider value. The epicycle center moves at constant angular speed relative to the equant point (the planet itself does not). At \(s=1\) this matches the Kepler ellipse to \(O(e^{2})\)—try Mars and watch the traces lock together. It applies only to the two-circle model (\(N=2\)).
The modern fix: each Kepler orbit is periodic, so it has a Fourier series \[ z_b(t) \;=\; \sum_{k} c_{k}\, e^{\,i k \omega_b t}, \] and the geocentric motion is a sum of circles with frequencies \(k\omega_p\) and \(k\omega_\oplus\). The slider keeps the \(N\) largest circles, chained one on top of another; each circle is centered on the tip of the previous one. The constant term (\(k=0\)) is a fixed offset of the center—an eccentric—drawn as an arm without a circle. As \(N\) grows, the model trace converges to the true one: "you can always add another epicycle."
Venus \((a,e,T) = (0.723, 0.007, 0.615)\), Earth \((1.000, 0.017, 1.000)\), Mars \((1.524, 0.093, 1.881)\), Jupiter \((5.203, 0.048, 11.862)\), with \(a\) in au and \(T\) in years.
S. D. Norton, “Ptolemaic Astronomy, Islamic Planetary Theory, and Copernicus's Debt to the Maragha School”, in Science and Its Times (Encyclopedia.com).