Mystery curve
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 2I.
Here's Python code to draw the curve.
import matplotlib.pyplot as pltfrom numpy import pi, exp, real, imag, linspacedef f(t): return exp(1j*t) - exp(6j*t)/2 + 1j*exp(-14j*t)/3t = linspace(0, 2*pi, 1000)plt.plot(real(f(t)), imag(f(t)))# These two lines make the aspect ratio squarefig = 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.
Related posts:
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.
John Golden created visualizations in GeoGerba here and here.
Jennifer Silverman showed how these curves are related to decorative patterns that popular in the 1960's. She also created a coloring book and a video.
Dan Anderson accused me of nerd sniping him and created this visualization.