Mystery Curve
Join the DZone community and get the full member experience.
Join For Freethis 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(6 it )/2 + i exp(-14 it )/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.
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 .
Opinions expressed by DZone contributors are their own.
Comments