ToolSphere
All Desmos art

Desmos Butterfly Curve Equation

The butterfly curve, found by Temple Fay in 1989, draws a whole butterfly with one equation.

Butterfly drawn from its Desmos equations
1 equation, t from 0 to 1

The picture above is drawn from exactly these equations. Paste them into the first empty line of the Desmos graphing calculator; each line becomes its own curve.

How it is built

In polar form it is

r = e^(cos θ) − 2 cos(4θ) − sin⁵(θ ÷ 12)

and here θ = 24πt, so t from 0 to 1 covers θ from 0 to 24π, the full curve. The e^(cos θ) term makes the big wings, −2 cos(4θ) adds the scalloped edges, and the slow sin⁵(θ/12) term shifts each loop slightly so the wings fill in with fine detail. Everything is doubled to make it a comfortable size.

Press Copy all equations, open the Desmos graphing calculator, click into the first empty expression line and paste: each line becomes its own curve. Every curve uses t from 0 to 1, which is Desmos's default, so there is nothing to set up. A thinner line (from the colour menu) shows the detail best.

Make your own

Frequently asked questions

What is the butterfly equation in Desmos?

r = e^(cos θ) − 2 cos(4θ) − sin⁵(θ/12), Temple Fay's butterfly curve. This page has it as one parametric equation for t from 0 to 1, ready to paste.

Why does my butterfly look incomplete?

The curve needs θ from 0 to 24π. If you type the polar form yourself, widen Desmos's θ range; the parametric version here already covers it.