One formula, a whole taxonomy of shapes
In 2003 the Belgian botanist and engineer Johan Gielis published a generalisation of the superellipse — itself a generalisation of the ellipse that Gabriel Lamé had introduced in 1818. Gielis's superformula adds a single new parameter, m, that sets how many lobes appear around the curve, and the result is one polar equation that can draw circles, squares, stars, gears, starfish and flower petals depending only on its eight numbers:
r(φ) = ( |cos(mφ/4)/a|^n2 + |sin(mφ/4)/b|^n3 )^(-1/n1) m → rotational symmetry: number of lobes/petals around the curve a,b → radius scale along the two axes n1 → overall roundness vs. pinch of the whole curve n2,n3 → sharpness of each individual lobe
Set m = 0 and n1 = n2 = n3 = 2 and the formula collapses to a perfect circle. Set m = 4 with matching n2, n3 and you get Lamé's superellipse — a smooth interpolation between a diamond, an ellipse and a rounded square. Push m up to 5, 6 or 12 and sharpen n2/n3 and the curve grows petals, gear teeth or starfish arms, all from the same six symbols.
From a 2D curve to a 3D supershape
A sphere in spherical coordinates needs two independent angles — a polar angle θ measured from the pole and an azimuthal angle φ swept around the equator. Gielis's trick for going 3D is to evaluate two separate superformulas, one as a function of θ and one as a function of φ, each with its own eight parameters, and multiply their radii together into a single spherical product surface:
r1 = superformula(θ) // latitude profile, θ ∈ [-π/2, π/2] r2 = superformula(φ) // longitude profile, φ ∈ [-π, π] x = r1·cos(θ) · r2·cos(φ) y = r1·cos(θ) · r2·sin(φ) z = r1·sin(θ)
Because the two profiles are independent, the north-south shape and the east-west shape can be tuned separately: a starfish silhouette pinched at the poles, a twisted torus, a faceted crystal, or a fluted, gourd-like blob. This is exactly the "supershape" family the demo on this page walks through — sixteen numbers in total, but only eight sliders because both profiles share the same m, a and b defaults until you decouple them.
Building the mesh
The simulation tessellates the surface as a latitude-longitude grid, evaluates the two radii at every (θ, φ) sample, converts to Cartesian coordinates and writes the results straight into a Three.js BufferGeometry position attribute. Because the whole surface is a pure function of its parameters, changing a slider means re-evaluating every vertex and re-uploading the buffer — no incremental patching, no simulation state to keep consistent, which is why the demo can respond to a slider drag at 60 fps even on a modest laptop GPU. Vertex normals are recomputed from neighbouring triangles each frame so the lighting reacts correctly even when the mesh flexes into sharp creases.
Why a botanist needed this
Gielis was not chasing abstract art — he was trying to describe the cross-sections of bamboo culms, which are neither circular nor elliptical but subtly polygonal with rounded corners, a shape that had no compact mathematical description until the superformula. The same equation turned out to fit diatom shells, starfish, sea urchins, snowflakes, spider webs and the radial symmetry of flowers with startling accuracy, using far fewer parameters than a generic Fourier fit would need. That efficiency is also what makes it a good procedural-art primitive: eight numbers, one equation, and the whole space of star-like symmetric solids is reachable by dragging sliders.
Frequently asked questions
Who invented the superformula and why?
Belgian botanist and engineer Johan Gielis published it in 2003 while looking for a single equation to describe the cross-sections of plants — bamboo culms, diatoms, starfish, flowers — that classical shapes like circles and superellipses could not capture in one formula.
How is the superformula different from a superellipse?
A superellipse is the special case m = 4, n2 = n3. The superformula adds the symmetry parameter m, which sets how many lobes or petals appear around the curve, so it covers stars, gears and flowers as well as ellipses and rectangles.
Why does the 3D version need two separate formulas?
A sphere needs two independent angles, latitude and longitude. Evaluating one superformula on each angle and multiplying the two radii gives a spherical product surface — a supershape — so the polar and azimuthal profiles can be shaped completely independently.
Try it live
Everything above runs in your browser — open Superformula 3D and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Superformula 3D simulation