Skip to content
ihateDesmos

The butterfly curve

The butterfly curve is a polar curve discovered by Temple H. Fay in 1989. A single equation combining an exponential, a cosine and a fifth power draws a remarkably lifelike butterfly with layered wings.

−4−3−2−11234−2−1120
Open in calculator
Fay’s butterfly, drawn for 0 ≤ t ≤ 12π.

Equations to type

Polar
r = e^sin(theta) - 2cos(4theta) + sin((2theta - pi)/24)^5
Open
Parametric
(sin(t)(e^cos(t) - 2cos(4t) - sin(t/12)^5), cos(t)(e^cos(t) - 2cos(4t) - sin(t/12)^5))
Open

At a glance

Discovered
Temple H. Fay, 1989
Closes after
t = 12π
Type
Transcendental (not algebraic)

How the equation makes wings

In polar form, r = e^(sin θ) − 2cos(4θ) + sin⁵((2θ − π)/24). The first term, e^(sin θ), makes r larger above the x-axis than below it, giving the big upper wings and smaller lower ones. The −2cos 4θ term creates four lobes, the basic wing shape.

The last term is the subtle one. Because of the division by 24, it changes very slowly, so each trip around the origin is slightly different from the last. That is what layers the wings, and why the curve takes 12π, six full turns, to draw completely.

Graphing it

The parametric form above is the same curve written with x = r sin t and y = r cos t, which turns it upright. Make sure t runs to 12π; with the default 0 to 2π you get only the first layer. The calculator samples the curve adaptively, so the tight inner loops stay smooth.

−4−224−220
Open in calculator
The same equation for 0 ≤ t ≤ 2π only: one layer of wings.

Make your own variations

Every term is a dial. Change −2cos 4θ to −2cos 6θ and the wings gain extra lobes; change e^(sin θ) to e^(cos θ) and the butterfly turns on its side; replace the fifth power with a cube and the layers spread further apart. Open the polar equation above, replace a number with a letter such as k, and accept the slider to explore.

Curves like this are a good reminder that polar equations are natural for shapes organised around a centre, from flowers to wings, because r directly controls how far each direction reaches.

Frequently asked questions

What is the butterfly curve equation?
In polar coordinates, r = e^(sin θ) − 2cos(4θ) + sin⁵((2θ − π)/24), drawn for 0 ≤ θ ≤ 12π.
Who discovered the butterfly curve?
Temple H. Fay, who published it in The American Mathematical Monthly in 1989.
Why does it need 12π?
The term sin⁵((2θ − π)/24) changes slowly, so the curve differs slightly on each turn and only repeats after six turns.

More curves

Make it your own

Every equation on this page opens in the calculator, where you can add sliders and watch the curve change.

Open the calculator