# superquadrics

In mathematics, the superquadrics  (also superquadratics) are a family of geometric shapes defined by formulas that resemble those of elipsoids and other quadrics, except that the squaring operations are replaced by arbitrary powers. The superquadrics include many shapes that resemble cubes, octahedra, cylinders, lozenges and spindles, with rounded or sharp corners. Because of their flexibility and relative simplicity, they are popular geometric modeling tools, especially in computer graphics.

### Implicit equation

The basic superquadric has the formula

$\left|x\right|^{r}+\left|y\right|^{s}+\left|z\right|^{t}=1$

where r, s, and t are positive real numbers that determine the main features of the superquadric. Namely:

• less than 1: a pointy octahedron with concave faces and sharp edges.
• exactly 1: a regular octahedron.
• between 1 and 2: an octahedron with convex faces, blunt edges and blunt corners.
• exactly 2: a sphere
• greater than 2: a cube with rounded edges and corners.
• infinite (in the limit): a cube

Each exponent can be varied independently to obtain combined shapes.

### Parametric description

Parametric equations in terms of surface parameters u and v (longitude and latitude) are

{\begin{aligned}x(u,v)&{}=Ac\left(v,{\frac {2}{r}}\right)c\left(u,{\frac {2}{r}}\right)\\y(u,v)&{}=Bc\left(v,{\frac {2}{s}}\right)s\left(u,{\frac {2}{s}}\right)\\z(u,v)&{}=Cs\left(v,{\frac {2}{t}}\right)\\&-{\frac {\pi }{2}}\leq v\leq {\frac {\pi }{2}},\quad -\pi \leq u<\pi ,\end{aligned}}

where the auxiliary functions are

{\begin{aligned}c(\omega ,m)&{}=\operatorname{sgn}(\cos \omega )|\cos \omega |^{m}\\s(\omega ,m)&{}=\operatorname{sgn}(\sin \omega )|\sin \omega |^{m}\end{aligned}}

and the sign function sgn(x) is

$\operatorname{sgn}(x)={\begin{cases}-1,&x<0\,&x=0\\+1,&x>0.\end{cases}}$