# Superellipsoid Superellipsoid collection with exponent parameters, created using POV-Ray. Here, e = 2/r, and n = 2/t (equivalently, r = 2/e and t = 2/n).

In mathematics, a superellipsoid (or super-ellipsoid) is a solid whose horizontal sections are superellipses (Lamé curves) with the same exponent r, and whose vertical sections through the center are superellipses with the same exponent t.

Superellipsoids as computer graphics primitives were popularized by Alan H. Barr (who used the name "superquadrics" to refer to both superellipsoids and supertoroids). However, while some superellipsoids are superquadrics, neither family is contained in the other.

## Special cases

A handful of notable mathematical figures can arise as special cases of superellipsoids given the correct set of values, which are depicted in the above graphic:

Piet Hein's supereggs are also special cases of superellipsoids.

## Formulas

### Basic shape

The basic superellipsoid is defined by the implicit inequality

$\left(\left|x\right|^{r}+\left|y\right|^{r}\right)^{t/r}+\left|z\right|^{t}\leq 1.$ The parameters r and t are positive real numbers that control the amount of flattening at the tips and at the equator. Note that the formula becomes a special case of the superquadric's equation if (and only if) t = r.

Any "parallel of latitude" of the superellipsoid (a horizontal section at any constant z between -1 and +1) is a Lamé curve with exponent r, scaled by $a=(1-\left|z\right|^{t})^{1/t}$ :

$\left|{\frac {x}{a}}\right|^{r}+\left|{\frac {y}{a}}\right|^{r}\leq 1.$ Any "meridian of longitude" (a section by any vertical plane through the origin) is a Lamé curve with exponent t, stretched horizontally by a factor w that depends on the sectioning plane. Namely, if x = u cos θ and y = u sin θ, for a fixed θ, then

$\left|{\frac {u}{w}}\right|^{t}+\left|z\right|^{t}\leq 1,$ where

$w=(\left|\cos \theta \right|^{r}+\left|\sin \theta \right|^{r})^{-1/r}.$ In particular, if r is 2, the horizontal cross-sections are circles, and the horizontal stretching w of the vertical sections is 1 for all planes. In that case, the superellipsoid is a solid of revolution, obtained by rotating the Lamé curve with exponent t around the vertical axis.

The basic shape above extends from −1 to +1 along each coordinate axis. The general superellipsoid is obtained by scaling the basic shape along each axis by factors A, B, C, the semi-diameters of the resulting solid. The implicit inequality is

$\left(\left|{\frac {x}{A}}\right|^{r}+\left|{\frac {y}{B}}\right|^{r}\right)^{t/r}+\left|{\frac {z}{C}}\right|^{t}\leq 1.$ Setting r = 2, t = 2.5, A = B = 3, C = 4 one obtains Piet Hein's superegg.

The general superellipsoid has a parametric representation in terms of surface parameters -π/2 < v < π/2, -π < u < π.

$x(u,v)=Ac\left(v,{\frac {2}{t}}\right)c\left(u,{\frac {2}{r}}\right)$ $y(u,v)=Bc\left(v,{\frac {2}{t}}\right)s\left(u,{\frac {2}{r}}\right)$ $z(u,v)=Cs\left(v,{\frac {2}{t}}\right)$ where the auxiliary functions are

$c(\omega ,m)=\operatorname {sgn}(\cos \omega )|\cos \omega |^{m}$ $s(\omega ,m)=\operatorname {sgn}(\sin \omega )|\sin \omega |^{m}$ and the sign function sgn(x) is

$\operatorname {sgn}(x)={\begin{cases}-1,&x<0\\0,&x=0\\+1,&x>0.\end{cases}}$ The volume inside this surface can be expressed in terms of beta functions (and Gamma functions, because β(m,n) = Γ(m)Γ(n) / Γ(m + n) ), as:

$V={\frac {2}{3}}ABC{\frac {4}{rt}}\beta \left({\frac {1}{r}},{\frac {1}{r}}\right)\beta \left({\frac {2}{t}},{\frac {1}{t}}\right).$ 