Superformula


The superformula is a generalization of the superellipse and was proposed by Johan Gielis around 2000. Gielis suggested that the formula can be used to describe many complex shapes and curves that are found in nature. Gielis has filed a patent application related to the synthesis of patterns generated by the superformula.
In polar coordinates, with the radius and the angle, the superformula is:
By choosing different values for the parameters and different shapes can be generated.
The formula was obtained by generalizing the superellipse, named and popularized by Piet Hein, a Danish mathematician.

2D plots

In the following examples the values shown above each figure should be = = m, n1, n2 and n3.
A GNU Octave program for generating these figures

function sf2d
u = ;
raux = abs.* abs).^ n + abs.* abs).^ n;
r = abs.^ ;
x = r.* cos;
y = r.* sin;
plot;
end

Extension to higher dimensions

It is possible to extend the formula to 3, 4, or n dimensions, by means of the spherical product of superformulas. For example, the 3D parametric surface is obtained by multiplying two superformulas r1 and r2. The coordinates are defined by the relations:
where varies between −π/2 and π/2 and θ between −π and π.

3D plots

3D superformula: a = b = 1; = = m, n1, n2 and n3 are shown in the pictures.
A GNU Octave program for generating these figures:

function sf3d
u = ;
v = ;
nu = length;
nv = length;
for i = 1:nu
for j = 1:nv
raux1 = abs * abs.* u)).^ n + abs * abs * u)).^ n;
r1 = abs.^ ;
raux2 = abs * abs * v)).^ n + abs * abs * v)).^ n;
r2 = abs.^ ;
x = r1 * cos * r2 * cos;
y = r1 * sin * r2 * cos;
z = r2 * sin;
endfor;
endfor;
mesh;
endfunction;

Generalization

The superformula can be generalized by replacing the parameter with y and with z:
This allows the creation of rotationally asymmetric and nested structures. In the following examples a, b, and are 1: