# Superquadrics

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Superquadrics
> Markdown URL: https://mediated.wiki/source/Superquadrics.md
> Source: https://en.wikipedia.org/wiki/Superquadrics
> Source revision: 1335483380
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Family of geometric shapes

Some superquadrics.

In [mathematics](/source/Mathematics), the **superquadrics** or **super-quadrics** (also **superquadratics**) are a family of [geometric shapes](/source/Geometry) defined by formulas that resemble those of [ellipsoids](/source/Ellipsoid) and other [quadrics](/source/Quadric), except that the [squaring](/source/Square_(algebra)) operations are replaced by arbitrary powers. They can be seen as the three-dimensional relatives of the [superellipses](/source/Superellipse). The term may refer to the solid object or to its [surface](/source/Surface_(mathematics)), depending on the context. The equations below specify the surface; the solid is specified by replacing the equality signs by less-than-or-equal signs.

The superquadrics include many shapes that resemble [cubes](/source/Cube), [octahedra](/source/Octahedron), [cylinders](/source/Cylinder_(geometry)), [lozenges](/source/Lozenge_(shape)) and [spindles](/source/Spindle_torus), with rounded or sharp corners.[1] Because of their flexibility and relative simplicity, they are popular [geometric modeling](/source/Geometric_model) tools, especially in [computer graphics](/source/Computer_graphics). It becomes an important [geometric primitive](/source/Geometric_primitive) widely used in [computer vision](/source/Computer_vision),[2][3] robotics,[4] and physical simulation.[5]

Some authors, such as [Alan Barr](https://en.wikipedia.org/w/index.php?title=Alan_H._Barr&action=edit&redlink=1), define "superquadrics" as including both the [superellipsoids](/source/Superellipsoid) and the [supertoroids](/source/Supertoroid).[1][6] In modern computer vision literatures, superquadrics and [superellipsoids](/source/Superellipsoid) are used interchangeably, since [superellipsoids](/source/Superellipsoid) are the most representative and widely utilized shape among all the superquadrics.[2][3] Comprehensive coverage of geometrical properties of superquadrics and methods of their recovery from [range images](/source/Range_image) and [point clouds](/source/Point_cloud) are covered in several computer vision literatures.[1][3][7][8]

## Formulas

### Implicit equation

The surface of the basic superquadric is given by

- | x | r + | y | s + | z | t = 1 {\displaystyle \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 modified to have [concave](/source/Concave_polygon) [faces](/source/Face_(geometry)) and sharp [edges](/source/Edge_(geometry)).

- exactly 1: a regular [octahedron](/source/Octahedron).

- between 1 and 2: an octahedron modified to have convex faces, blunt edges and blunt corners.

- exactly 2: a sphere

- greater than 2: a cube modified to have rounded edges and corners.

- [infinite](/source/Infinity_(mathematics)) (in the [limit](/source/Limit_(mathematics))): a cube

Each exponent can be varied independently to obtain combined shapes. For example, if *r*=*s*=2, and *t*=4, one obtains a [solid of revolution](/source/Solid_of_revolution) which resembles an ellipsoid with round cross-section but flattened ends. This formula is a special case of the superellipsoid's formula if (and only if) *r* = *s*.

If any exponent is allowed to be negative, the shape extends to infinity. Such shapes are sometimes called **super-hyperboloids**.

The basic shape above spans from -1 to +1 along each coordinate axis. The general superquadric is the result of [scaling](/source/Similarity_(geometry)) this basic shape by different amounts *A*, *B*, *C* along each axis. Its general equation is

- | x A | r + | y B | s + | z C | t = 1. {\displaystyle \left|{\frac {x}{A}}\right|^{r}+\left|{\frac {y}{B}}\right|^{s}+\left|{\frac {z}{C}}\right|^{t}=1.}

### Parametric description

Parametric equations in terms of surface parameters *u* and *v* (equivalent to longitude and latitude if m equals 2) are

- x ( u , v ) = A g ( v , 2 r ) g ( u , 2 r ) y ( u , v ) = B g ( v , 2 s ) f ( u , 2 s ) z ( u , v ) = C f ( v , 2 t ) − π 2 ≤ v ≤ π 2 , − π ≤ u < π , {\displaystyle {\begin{aligned}x(u,v)&{}=Ag\left(v,{\frac {2}{r}}\right)g\left(u,{\frac {2}{r}}\right)\\y(u,v)&{}=Bg\left(v,{\frac {2}{s}}\right)f\left(u,{\frac {2}{s}}\right)\\z(u,v)&{}=Cf\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](/source/Auxiliary_function) are

- f ( ω , m ) = sgn ⁡ ( sin ⁡ ω ) | sin ⁡ ω | m g ( ω , m ) = sgn ⁡ ( cos ⁡ ω ) | cos ⁡ ω | m {\displaystyle {\begin{aligned}f(\omega ,m)&{}=\operatorname {sgn}(\sin \omega )\left|\sin \omega \right|^{m}\\g(\omega ,m)&{}=\operatorname {sgn}(\cos \omega )\left|\cos \omega \right|^{m}\end{aligned}}}

and the [sign function](/source/Sign_function) sgn(*x*) is

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

### Spherical product

Barr introduces the *spherical product* which given two plane curves produces a 3D surface. If f ( μ ) = ( f 1 ( μ ) f 2 ( μ ) ) , g ( ν ) = ( g 1 ( ν ) g 2 ( ν ) ) {\displaystyle f(\mu )={\begin{pmatrix}f_{1}(\mu )\\f_{2}(\mu )\end{pmatrix}},\quad g(\nu )={\begin{pmatrix}g_{1}(\nu )\\g_{2}(\nu )\end{pmatrix}}} are two plane curves then the spherical product is h ( μ , ν ) = f ( μ ) ⊗ g ( ν ) = ( f 1 ( μ ) g 1 ( ν ) f 1 ( μ ) g 2 ( ν ) f 2 ( μ ) ) {\displaystyle h(\mu ,\nu )=f(\mu )\otimes g(\nu )={\begin{pmatrix}f_{1}(\mu )\ g_{1}(\nu )\\f_{1}(\mu )\ g_{2}(\nu )\\f_{2}(\mu )\end{pmatrix}}} This is similar to the typical parametric equation of a [sphere](/source/Sphere): x = x 0 + r sin ⁡ θ cos ⁡ φ y = y 0 + r sin ⁡ θ sin ⁡ φ ( 0 ≤ θ ≤ π , 0 ≤ φ < 2 π ) z = z 0 + r cos ⁡ θ {\displaystyle {\begin{aligned}x&=x_{0}+r\sin \theta \;\cos \varphi \\y&=y_{0}+r\sin \theta \;\sin \varphi \qquad (0\leq \theta \leq \pi ,\;0\leq \varphi <2\pi )\\z&=z_{0}+r\cos \theta \end{aligned}}} which give rise to the name spherical product.

Barr uses the spherical product to define quadric surfaces, like [ellipsoids](/source/Ellipsoid), and [hyperboloids](/source/Hyperboloid) as well as the [torus](/source/Torus), [superellipsoid](/source/Superellipsoid), superquadric hyperboloids of one and two sheets, and supertoroids.[1]

## Plotting code

The following [GNU Octave](/source/GNU_Octave) code generates a mesh approximation of a superquadric:

function superquadric(epsilon, a)
  n = 50;
  etamax = pi / 2;
  etamin = -pi / 2;
  wmax = pi;
  wmin = -pi;
  deta = (etamax - etamin) / n;
  dw = (wmax - wmin) / n;
  [i, j] = meshgrid(1:n+1, 1:n+1)
  eta = etamin + (i - 1) * deta;
  w   = wmin + (j - 1) * dw;
  x = a(1) .* sign(cos(eta)) .* abs(cos(eta)).^epsilon(1) .* sign(cos(w)) .* abs(cos(w)).^epsilon(1);
  y = a(2) .* sign(cos(eta)) .* abs(cos(eta)).^epsilon(2) .* sign(sin(w)) .* abs(sin(w)).^epsilon(2);
  z = a(3) .* sign(sin(eta)) .* abs(sin(eta)).^epsilon(3);

  mesh(x, y, z);
end

## See also

- [Superegg](/source/Superegg)

- [Superellipsoid](/source/Superellipsoid)

- [Ellipsoid](/source/Ellipsoid)

## References

1. ^ [***a***](#cite_ref-barr81_1-0) [***b***](#cite_ref-barr81_1-1) [***c***](#cite_ref-barr81_1-2) [***d***](#cite_ref-barr81_1-3) Barr (1 January 1981). "Superquadrics and Angle-Preserving Transformations". *IEEE Computer Graphics and Applications*. **1** (1): 11–23. [doi](/source/Doi_(identifier)):[10.1109/MCG.1981.1673799](https://doi.org/10.1109%2FMCG.1981.1673799). [ISSN](/source/ISSN_(identifier)) [0272-1716](https://search.worldcat.org/issn/0272-1716). [S2CID](/source/S2CID_(identifier)) [9389947](https://api.semanticscholar.org/CorpusID:9389947).

1. ^ [***a***](#cite_ref-:1_2-0) [***b***](#cite_ref-:1_2-1) Paschalidou, Despoina; Ulusoy, Ali Osman; Geiger, Andreas (2019). "Superquadrics Revisited: Learning 3D Shape Parsing Beyond Cuboids". *2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*. pp. 10336–10345. [arXiv](/source/ArXiv_(identifier)):[1904.09970](https://arxiv.org/abs/1904.09970). [doi](/source/Doi_(identifier)):[10.1109/CVPR.2019.01059](https://doi.org/10.1109%2FCVPR.2019.01059). [ISBN](/source/ISBN_(identifier)) [978-1-7281-3293-8](https://en.wikipedia.org/wiki/Special:BookSources/978-1-7281-3293-8). [S2CID](/source/S2CID_(identifier)) [128265641](https://api.semanticscholar.org/CorpusID:128265641).

1. ^ [***a***](#cite_ref-:0_3-0) [***b***](#cite_ref-:0_3-1) [***c***](#cite_ref-:0_3-2) Liu, Weixiao; Wu, Yuwei; Ruan, Sipu; Chirikjian, Gregory S. (2022). "Robust and Accurate Superquadric Recovery: A Probabilistic Approach". *2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*. pp. 2666–2675. [arXiv](/source/ArXiv_(identifier)):[2111.14517](https://arxiv.org/abs/2111.14517). [doi](/source/Doi_(identifier)):[10.1109/CVPR52688.2022.00270](https://doi.org/10.1109%2FCVPR52688.2022.00270). [ISBN](/source/ISBN_(identifier)) [978-1-6654-6946-3](https://en.wikipedia.org/wiki/Special:BookSources/978-1-6654-6946-3). [S2CID](/source/S2CID_(identifier)) [244715106](https://api.semanticscholar.org/CorpusID:244715106).

1. **[^](#cite_ref-4)** Ruan, Sipu; Wang, Xiaoli; Chirikjian, Gregory S. (2022). ["Collision Detection for Unions of Convex Bodies With Smooth Boundaries Using Closed-Form Contact Space Parameterization"](https://doi.org/10.1109%2FLRA.2022.3190629). *IEEE Robotics and Automation Letters*. **7** (4): 9485–9492. [Bibcode](/source/Bibcode_(identifier)):[2022IRAL....7.9485R](https://ui.adsabs.harvard.edu/abs/2022IRAL....7.9485R). [doi](/source/Doi_(identifier)):[10.1109/LRA.2022.3190629](https://doi.org/10.1109%2FLRA.2022.3190629). [ISSN](/source/ISSN_(identifier)) [2377-3766](https://search.worldcat.org/issn/2377-3766). [S2CID](/source/S2CID_(identifier)) [250543506](https://api.semanticscholar.org/CorpusID:250543506).

1. **[^](#cite_ref-5)** Lu, G.; Third, J. R.; Müller, C. R. (2012-08-20). ["Critical assessment of two approaches for evaluating contacts between super-quadric shaped particles in DEM simulations"](https://www.sciencedirect.com/science/article/pii/S0009250912003223). *Chemical Engineering Science*. **78**: 226–235. [Bibcode](/source/Bibcode_(identifier)):[2012ChEnS..78..226L](https://ui.adsabs.harvard.edu/abs/2012ChEnS..78..226L). [doi](/source/Doi_(identifier)):[10.1016/j.ces.2012.05.041](https://doi.org/10.1016%2Fj.ces.2012.05.041). [ISSN](/source/ISSN_(identifier)) [0009-2509](https://search.worldcat.org/issn/0009-2509).

1. **[^](#cite_ref-barr92_6-0)** Alan H. Barr (1992), *Rigid Physically Based Superquadrics*. Chapter III.8 of *Graphics Gems III*, edited by D. Kirk, pp. 137–159

1. **[^](#cite_ref-7)** Aleš Jaklič, Aleš Leonardis, Franc Solina (2000) *Segmentation and Recovery of Superquadrics*. Kluwer Academic Publishers, Dordrecht

1. **[^](#cite_ref-8)** Wu, Yuwei; Liu, Weixiao; Ruan, Sipu; Chirikjian, Gregory S. (2022). ["Primitive-Based Shape Abstraction via Nonparametric Bayesian Inference"](https://link.springer.com/chapter/10.1007/978-3-031-19812-0_28). In Avidan, Shai; Brostow, Gabriel; Cissé, Moustapha; Farinella, Giovanni Maria; Hassner, Tal (eds.). *Computer Vision – ECCV 2022*. Lecture Notes in Computer Science. Vol. 13687. Cham: Springer Nature Switzerland. pp. 479–495. [arXiv](/source/ArXiv_(identifier)):[2203.14714](https://arxiv.org/abs/2203.14714). [doi](/source/Doi_(identifier)):[10.1007/978-3-031-19812-0_28](https://doi.org/10.1007%2F978-3-031-19812-0_28). [ISBN](/source/ISBN_(identifier)) [978-3-031-19812-0](https://en.wikipedia.org/wiki/Special:BookSources/978-3-031-19812-0).

## External links

- [Bibliography: SuperQuadric Representations](http://iris.usc.edu/Vision-Notes/bibliography/describe461.html)

- [Superquadric Tensor Glyphs](http://www.cs.utah.edu/~gk/papers/vissym04/)

- [SuperQuadric Ellipsoids and Toroids, OpenGL Lighting, and Timing](http://www.gamedev.net/reference/articles/article1172.asp)

- [Superquadrics](http://demonstrations.wolfram.com/Superquadrics/) by Robert Kragler, [The Wolfram Demonstrations Project](/source/The_Wolfram_Demonstrations_Project).

- [Superquadrics in Python](https://github.com/pratikmallya/Superquad)

- [Superquadrics recovery algorithm in Python and MATLAB](https://github.com/bmlklwx/EMS-superquadric_fitting)

---
Adapted from the Wikipedia article [Superquadrics](https://en.wikipedia.org/wiki/Superquadrics) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Superquadrics?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
