Superellipse Family
Drag the slider for the exponent n in |x|^n + |y|^n = 1 and watch the superellipse change from astroid to diamond, circle and squircle. Edit the equation.
The fountain of Sergels Torg in Stockholm is outlined by a curve that is neither an ellipse nor a rectangle: |x/a|^n + |y/b|^n = 1 , with n = 2.5 and a/b = 6/5 . The Danish poet and scientist Piet Hein proposed it in a design challenge of 1959; the square was finished in 1967. The curve is a superellipse, also called a Lamé curve after Gabriel Lamé, who studied it in 1818. Designers use the family for shapes between the circle and the square.
The plot draws |x|^n + |y|^n = 1 (a = b = 1 ); the slider moves n from 0.5 to 4 , starting at 3 . Drag it: below 1 the sides curve inward between four cusps, and n = 2/3 gives the astroid; n = 1 gives a diamond, n = 2 the circle, and above 2 the corners fill out toward a square, the squircle. Set n = 2.5 for Hein's exponent, without his 6:5 ratio. Notice that no value of n gives a square: the corners only get sharper as n grows.
JavaScript is required to view the interactive plot.