This afternoon I got a review copy of the book Creating Symmetry: The Artful Mathematics of Wallpaper Patterns. Here’s a striking curves from near the beginning of the book, one that the author calls the “mystery curve.”
The curve is the plot of exp(it) – exp(6it)/2 + i exp(-14it)/3 with t running from 0 to 2π.
Here’s Python code to draw the curve.
import matplotlib.pyplot as plt from numpy import pi, exp, real, imag, linspace def f(t): return exp(1j*t) - exp(6j*t)/2 + 1j*exp(-14j*t)/3 t = linspace(0, 2*pi, 1000) plt.plot(real(f(t)), imag(f(t))) # These two lines make the aspect ratio square fig = plt.gcf() fig.gca().set_aspect('equal') plt.show()
Maybe there’s a more direct way to plot curves in the complex plane rather than taking real and imaginary parts.
Updated code for the aspect ratio per Janne’s suggestion in the comments.
Several people have been making fun visualizations that generalize the example above.
Brent Yorgey has written two posts, one choosing frequencies randomly and another that animates the path of a particle along the curve and shows how the frequency components each contribute to the motion.
Mike Croucher developed a Jupyter notebook that lets you vary the frequency components with sliders.