← Iris

Parameter a 25
Parameter b 24
Topology two loops
Adjust a and b to morph the curve • hover to inspect coordinates
Parameter a 25
Parameter b 24

The devil’s curve equation

The devil’s curve is defined by the implicit equation y4 − x4 + ay2 + bx2 = 0, where a and b are real parameters. It belongs to a family of quartic plane curves that exhibit rich topological behavior. The name “devil’s curve” comes from the classic case a = 25, b = 24, where the curve forms a shape reminiscent of a devil’s hourglass or bowtie.

Special cases and topology

When a = b, the equation factors as (y2 + x2)(y2 − x2 + a) = 0, producing a pair of circles (or lines when a = 0). When a > b, the curve typically shows two loops connected at the origin. When a < b, the loops disconnect into separate components. The transition between these topologies is a bifurcation that happens precisely at a = b.

Marching squares algorithm

This visualization uses the marching squares algorithm to render the implicit curve. The plane is divided into a grid of cells. For each cell, the function f(x,y) = y4 − x4 + ay2 + bx2 is evaluated at the four corners. If the sign changes between adjacent corners, the curve passes through that edge, and linear interpolation determines where. The algorithm connects these crossing points to trace out the curve, efficiently handling the complex topology of implicit curves.

Historical context

Gabriel Cramer studied this curve around 1750. It appears in his Introduction à l’analyse des lignes courbes algébriques. The devil’s curve is related to other notable algebraic curves like lemniscates and foliums. It serves as an excellent example for exploring how changes in parameters can produce qualitative changes in the shape of algebraic curves — a theme central to algebraic geometry and bifurcation theory.