Butterfly Curve
Edit the parametric equations of Temple Fay's butterfly curve, which mixes e^cos(t), cos(4t) and sin(t/12) over 0 ≤ t ≤ 12π, and replot it.
In May 1989, Temple H. Fay, a mathematician at the University of Southern Mississippi, published a two-page article in the American Mathematical Monthly titled "The Butterfly Curve". Its subject is one formula that mixes exponential and trigonometric terms, including the fifth power of a sine, and the shape it draws: a butterfly with scalloped wings. It is a transcendental curve, one whose equation is not a polynomial, and it belongs to a small family of named curves that people keep for the shape they make.
The parameterization combines \sin(t) , \cos(t) , \exp(\cos(t)) , \cos(4t) and \sin(t/12) , over the long interval 0 \le t \le 12\pi . The \sin(t/12) factor is the key: every other term repeats after 2\pi , so without it the curve would trace the same closed loop six times; with it, each of the six turns around the origin is slightly different, which gives the dense overlapping detail. A single purple stroke traces the entire path, so the symmetry and the small nested loops along each wing read as one continuous trajectory.
The butterfly curve equation, in the form Wikipedia gives and this graph plots, is x = \sin t\,\left(e^{\cos t} - 2\cos 4t - \sin^5\frac{t}{12}\right) , y = \cos t\,\left(e^{\cos t} - 2\cos 4t - \sin^5\frac{t}{12}\right) for 0 \le t \le 12\pi . In polar coordinates the same curve is r = e^{\sin\theta} - 2\cos 4\theta + \sin^5\left(\frac{2\theta - \pi}{24}\right) . The two forms agree when \theta = \pi/2 - t : the parametric point is r times (\sin t, \cos t) , so t is the angle measured from the positive y -axis, not from the x -axis.
The curve needs t to run to 12\pi . The terms \sin t , \cos t , e^{\cos t} and \cos 4t all have period 2\pi ; only \sin^5(t/12) changes from one turn to the next. At t = 12\pi this term is \sin^5\pi = 0 , its value at t = 0 , and the point is back at its start, (0, e - 2) , so the six turns form one closed curve. The formulas themselves repeat only after 24\pi : continuing past 12\pi draws a second, different set of loops. Wikipedia notes that the \sin^5 term was added for aesthetic reasons, to make the butterfly look fuller.
The butterfly graph is symmetric about the vertical axis. Replacing t by 12\pi - t changes the sign of \sin t and leaves \cos t , \cos 4t and \sin(t/12) unchanged, so the point (x, y) becomes (-x, y) : the second half of the stroke is the mirror image of the first. Edit the formula and notice the role of each term: delete \sin^5(t/12) and the six turns fall onto one curve; give it a larger factor, such as 3\sin^5(t/12) , and the six turns move further apart.
JavaScript is required to view the interactive plot.