The mathematical beauty of epicycles

Juan Carlos Ponce Campuzano

πŸ”— jcponce.com

A mysterious curve

The mathematical beauty of epicycles

What are epicycles?

A circle moving on another circle.

What are epicycles?

A circle moving on another circle, on another circle.

What are epicycles?

A circle moving on another circle, on another circle, on another circle...

What are epicycles?

\left\{ \begin{array}{l} x(t) \\ y(t) \end{array} \right. 0\leq t \leq 2\pi
\big(x(t) , y(t) \big)

How can we represent them mathematically?

A parametric function!

\big(x , y \big)

What are epicycles?

πŸ”

Code:

D2TE AWBC

What are epicycles?

πŸ”

Work only withΒ 

  • Simple rotation
  • Double rotation

Code:

D2TE AWBC

\left\{ \begin{array}{l} R \cos( \omega t) \\ R\, \sin(\omega t) \end{array} \right. 0\leq t \leq 2\pi

Simple rotations

\big(R\cos(\omega t),R\sin(\omega t)\big)
\text{with \,}0\leq t\leq 2\pi

Both represent

the same thing!

Simple rotations

\(\sin x\)

Simple rotations

\(\sin x\) and \(\cos x\)

Double rotations

\left\{ \begin{array}{l} R_1 \cos(\omega_1 t) + R_2 \cos(\omega_2 t)\\ R_1 \,\sin(\omega_1 t) + R_2 \,\sin(\omega_2 t) \end{array} \right. 0\leq t \leq 2\pi

Triple rotations

\left\{ \begin{array}{l} R_1 \cos(\omega_1 t) + R_2 \cos(\omega_2 t) + R_3 \cos(\omega_3 t) \\ R_1 \sin(\omega_1 t) + R_2 \sin(\omega_2 t) + R_3 \sin(\omega_3 t) \end{array} \right.

Triple rotations

\left\{ \begin{array}{l} R_1 \cos(\omega_1 t) + R_2 \cos(\omega_2 t) + R_3 \cos(\omega_3 t) \\ R_1 \,\sin(\omega_1 t) + R_2 \,\sin(\omega_2 t) + R_3 \sin(\omega_3 t) \end{array} \right.
R_1 = 1, R_2 = \dfrac{1}{2}, R_3 = \dfrac{1}{3}
\omega_1 = 1,
\omega_2 =6,
\omega_3 = -14

πŸ‘‰

Complete last task!

\left\{ \begin{array}{l} R_1 \cos(\omega_1 t) + R_2 \cos(\omega_2 t) + R_3 \cos(\omega_3 t) \\ R_1 \,\sin(\omega_1 t) + R_2 \,\sin(\omega_2 t) + R_3 \sin(\omega_3 t) \end{array} \right.

A parametric function with sin and cos functions

0\leq t\leq 2\pi

What are epicycles?

\left\{ \begin{array}{l} \displaystyle \sum_{k=1}^{3} R_k\cos(\omega_k t ) \\ \displaystyle \sum_{k=1}^{3}R_k\sin(\omega_k t ) \end{array} \right. \; 0\leq t\leq 2\pi

What are epicycles?

In general we have:

This new symbol \(\phi_k\) indicates how much the disk \(k\) is initially rotated at time \(t = 0\), and we called a phase offset.

If we do not specify a phase offset, we can only describe epicycles where the circles start aligned.

\left\{ \begin{array}{l} \displaystyle \sum_{k=1}^{N} R_k\cos(\omega_k t + \phi_k) \\ \displaystyle \sum_{k=1}^{N}R_k\sin(\omega_k t + \phi_k) \end{array} \right. \; 0\leq t\leq 2\pi

What are epicycles?

This new symbol \(\phi_k\) indicates how much the disk \(k\) is initially rotated at time \(t = 0\), and we called a phase offset.

If we do not specify a phase offset, we can only describe epicycles where the circles start aligned.

\left\{ \begin{array}{l} \displaystyle \sum_{k=1}^{N} R_k\cos(\omega_k t + \phi_k) \\ \displaystyle \sum_{k=1}^{N}R_k\sin(\omega_k t + \phi_k) \end{array} \right. \; 0\leq t\leq 2\pi

How can we determine the epicycles for our mysterious curve?

How can we determine the epicycles for our mysterious curve?

c(t) = \left\{ \begin{array}{l} R_1 \cos(\omega_1 t) + R_2 \cos(\omega_2 t) + R_3 \cos(\omega_3 t) \\ R_1 \sin(\omega_1 t) + R_2 \sin(\omega_2 t) + R_3 \sin(\omega_3 t) \end{array} \right.
(0\lt R_k\in \mathbb R, \;\omega_k\in \mathbb Z)
  • \(R_1, R_2, R_3\) are positive real numbers
  • \(\omega_1, \omega_2, \omega_3\) are integers (\(\ldots,-2,-1,0,1,2,\ldots\))

How can we determine the epicycles for our mysterious curve?

It is going to get complex!

=\cos t + i \sin t
= e^{i t}
\big(R_1 \cos (\omega_1 t), R_1 \sin (\omega_1 t)\big)
= R_1e^{i \omega_1 t}
i = \sqrt{-1}
(\cos t, \sin t)
0\lt R_k\in \mathbb R, \;\omega_k\in \mathbb Z

It is going to get complex!

c(t) = \left\{ \begin{array}{l} R_1 \cos(\omega_1 t) + R_2 \cos(\omega_2 t) + R_3 \cos(\omega_3 t) \\ R_1 \sin(\omega_1 t) + R_2 \sin(\omega_2 t) + R_3 \sin(\omega_3 t) \end{array} \right.
c(t)= R_1e^{ \omega_1 i t}+R_2e^{ \omega_2 i t}+R_3e^{ \omega_3 i t}
0\lt R_k\in \mathbb R, \;\omega_k\in \mathbb Z

It is going to get complex!

c(t)= C_1e^{ \omega_1 i t}+C_2e^{ \omega_2 i t}+C_3e^{ \omega_3 i t}
C_k \text{ is a complex number}, \;\omega_k\in \mathbb Z

It is going to get complex!

C_k = a + i b = (a,b)

The mysterious curve

c(t) = e^{it} + \dfrac{1}{2}e^{6 i t} + \dfrac{i}{3}e^{-14 i t}
c(t)= C_1e^{ \omega_1 i t}+C_2e^{ \omega_2 i t}+C_3e^{ \omega_3 i t}
C_1=1,\,C_2=\dfrac{1}{2},\, C_3= \dfrac{i}{3}
\omega_1=1,\,\omega_2=6,\, \omega_3=-14

The mysterious curve

c(t) = \left\{ \begin{array}{l} \displaystyle \cos( t) +\frac{1}{2}\cos(6 t) +\frac{1}{3}\sin(14 t) \\ \\ \displaystyle \sin( t) +\frac{1}{2} \sin(6 t)\, +\frac{1}{3} \cos(14 t) \end{array} \right.

Using properties of complex numbers:

\(i\cdot i = -1\)

More mystery curves

c(t)= C_1e^{ \omega_1 i t}+C_2e^{ \omega_2 i t}+C_3e^{ \omega_3 i t}
c(t)= C_1e^{ \omega_1 i t}+C_2e^{ \omega_2 i t}+\cdots + C_Ne^{ \omega_N i t}

More mystery curves

c(t)= C_1e^{ \omega_1 i t}+C_2e^{ \omega_2 i t}+\cdots + C_Ne^{ \omega_N i t}
c(t)= C_1e^{ \omega_1 i t}+C_2e^{ \omega_2 i t}+\cdots + C_Ne^{ \omega_N i t}

In fact we can use this equation to create more complex epicycles!

Discrete Fourier Transform

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

In fact we can use this equation to create more complex epicycles!

c(t)= \displaystyle \sum_{k=1}^{N} C_ke^{ \omega_k i t }
X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }
x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

\(\Bigg\{\Bigg.\)

Discrete Fourier Transform

πŸ‘ˆ DFT

The inverse of the DFT

πŸ‘ˆ

(DFT)

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }
x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }
c(t)= C_1e^{ \omega_1 i t}+C_2e^{ \omega_2 i t}+\cdots + C_Ne^{ \omega_N i t}

They are very similar to this:

\(\Bigg\{\Bigg.\)

Discrete Fourier Transform (DFT)

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }
x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

They are very similar to this:

\(\Bigg\{\Bigg.\)

Discrete Fourier Transform (DFT)

c(t) = \left\{ \begin{array}{l} \text{Sum of a bunch sines and cosines} \\ \text{Sum of a bunch sines and cosines} \end{array} \right.

Discrete Fourier Transform (DFT)

A nice methaphor πŸ˜ƒ

What does the Discrete Fourier Transform do?

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

Given a smoothie, it finds the recipe.

A nice methaphor πŸ˜ƒ

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

πŸ“ 🍌πŸ₯­πŸ

🫐🍍πŸ₯πŸ«

How does it do that?

A nice methaphor πŸ˜ƒ

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

How does it do that?

Run the smoothie through filters to extract each ingredient.

πŸ“ 🍌πŸ₯­πŸ

🫐🍍πŸ₯πŸ«

A nice methaphor πŸ˜ƒ

πŸ“ 🍌πŸ₯­πŸ

🫐🍍πŸ₯πŸ«

Why do we want to do this?

Recipes are easy to analyse, compare, than the smoothie itself.

A nice methaphor πŸ˜ƒ

πŸ“ 🍌πŸ₯­πŸ

🫐🍍πŸ₯πŸ«

How do we get the smoothie back?

Blend the ingredients.

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

A nice methaphor πŸ˜ƒ

πŸ“ 🍌πŸ₯­πŸ

🫐🍍πŸ₯πŸ«

How do we get the smoothie back?

Blend the ingredients.

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

Applications of the DFT

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

Modern digital media

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

Applications of the DFT

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

Video

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

Applications of the DFT

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

Images

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

Applications of the DFT

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

Magnetic Resonance Imaging

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }

Applications of the DFT

X_k = \displaystyle \frac{1}{N} \sum_{n=0}^{N-1} x_n \cdot e^{- i k \frac{2 \pi }{N} n }

Sound

x_n =\displaystyle \sum_{ k=0}^{N-1} X_{k} \cdot e^{ i k \frac{2 \pi }{N} n }
R1 = Slider(0, 5, 0.01, 1, 200)
R2 = Slider(0, 5, 0.01, 1, 200)
R3 = Slider(0, 5, 0.01, 1, 200)
w1 = Slider(-10, 10, 1, 1, 200)
w2 = Slider(-10, 10, 1, 1, 200)
w3 = Slider(-10, 10, 1, 1, 200)

fx(x) = R1 * cos(w1 * x) + R2 * cos(w2 * x) + R3 * cos(w3 * x)
fy(x) = R1 * sin(w1 * x) + R2 * sin(w2 * x) + R3 * sin(w3 * x)

c = Curve(fx(t), fy(t), t, 0, 2pi)

The beauty of mathematics shows itself to patient followers.

- Maryam Mirzakhani

The mathematical beauty of epicycles

By Juan Carlos Ponce Campuzano

The mathematical beauty of epicycles

The mathematical beauty of epicycles

  • 1,507