This is a demonstration of a concept known as the Discrete Fourier Transform (DFT) in the complex plane. Essentially, DFT is a way of converting a periodic singal from a time domain into a frequency domain.
On this site, a path (created from a finite number of points, shown in blue) is the input function. This function is then approximated via trigonometric interpolation using DFT, resulting in a series of epicycles (points moving around circles at constant speeds). These are displayed to trace out the approximation!
If you'd like to learn more about the math behind epicycles and DFT, check out this paper by Juan Carlos Ponce Campuzano describing the process. I found it helpful in creating this site!
Short answer: computers are fast at math :)
Longer answer: The cool thing about DFT is that every calculation that occurs is addition, subtraction, multiplication, division, or trigonometric functions. Computers are well-optimized for these operations (as opposed to more complicated ones like integrals), so they happen very fast. Additionally, this site compiles C++ code to WebAssembly, essentially allowing fast C++ code to run in your web browser! This makes the calculation process much faster than if it happened in JavaScript.
Hello! My name is Christian Bernier, and I'm a student studying computer science and physics. I have long been interested in this phenomenon, ever since the 3Blue1Brown video on the topic. I thought this site would be a fun way to learn more about the discrete Fourier transform, try my hand at WebAssembly, and share the cool math with my friends and family. I hope you enjoy it!
I was inspired to make this site after watching this excellent YouTube video from 3Blue1Brown! I followed this paper to learn about the math behind epicycles and DFT. I also got the coordinates for the square path from this paper. I used the set of coordinates from this post from a user named Chris on StackExchange for the pi path.