A circle, a rounded square, a starfish, a clover leaf: can one equation describe them all? In 2003 Johan Gielis proposed a formula in polar coordinates with just six parameters that draws all of these and much more.
How it works
The starting point is Lamé's superellipse, |x|ⁿ + |y|ⁿ = 1. At n = 1 it is a diamond, at n = 2 a circle; as n grows it becomes a square with ever sharper corners, and below 1 a four-pointed star with concave sides. Gielis multiplied the angle by m/4, so the figure repeats m times per turn, gave the sine and cosine exponents of their own, and put a common exponent outside.
“Symmetry m” is the number of rays. “n₁ — pinch” works like a magnifying glass: a small n₁ blows any bump up into a spike, a large one smooths everything towards a circle. n₂ and n₃ bend the sides, each its own half: n₃ shapes the curve near one set of rays, n₂ near the other, so when n₂ ≠ n₃ neighbouring rays differ. “a : b” stretches the even rays against the odd ones. With n₂ = n₃ = 2 and a : b = 1 the terms add up to cos² + sin² = 1: a circle, whatever m and n₁.
The “nested outlines” mode shrinks the shape step by step, rounding and twisting it towards the centre as n₁ grows; “grid” lays shapes out in cells; “table of shapes” is a periodic table, with m growing along the rows, n₁ down the columns and side curvature along the diagonal.
A bit of history
The French mathematician Gabriel Lamé studied the curves |x/a|ⁿ + |y/b|ⁿ = 1 in 1818. In 1959 the Danish polymath Piet Hein proposed a superellipse with n = 2.5 for Sergels torg in Stockholm, a compromise between a circle and a rectangle that suited both the city grid and the traffic. Gielis published his generalisation in the American Journal of Botany and filed a patent application on generating patterns with it, which expired in 2020.
What to tweak
- Start from a circle: with n₂ = n₃ = 2, n₁ does nothing. Take n₂ and n₃ below 2 and m rays appear; above 2, m bulging corners. Now n₁ decides whether they are sharp or soft.
- “Symmetry m” at 5 with “n₁ — pinch” around 0.3 gives a starfish; m at 4 with all three exponents at 4, a rounded square.
- Pull n₂ and n₃ apart, say 1 and 8: some rays sharpen while their neighbours turn blunt.
- “Mode” set to “table of shapes” with “Variation” at 1 is a ready-made atlas of supershapes.
- Put the “Dither” effect on top in “1-bit” mode for the look of an old computer magazine.