# Supertoroid

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

Family of geometric shapes

This article relies largely or entirely on a single source. Please help improve this article by citing more sources. Find sources: "Supertoroid" – news · newspapers · books · scholar · JSTOR (January 2022)

Supertoroids with *a* = *b* = 2, and different combinations for the parameters s and t.

In [geometry](/source/Geometry) and [computer graphics](/source/Computer_graphics), a **supertoroid** or **supertorus** is usually understood to be a family of [doughnut](/source/Doughnut)-like [surfaces](/source/Surface_(geometry)) (technically, a [topological](/source/Topology) [torus](/source/Torus_(mathematics))) whose shape is defined by mathematical formulas similar to those that define the [superellipsoids](/source/Superellipsoid). The plural of "supertorus" is either **supertori** or **supertoruses**.

The family was described and named by [Alan Barr](https://en.wikipedia.org/w/index.php?title=Alan_H.Barr&action=edit&redlink=1) in 1994.[1]

Barr's supertoroids have been fairly popular in computer graphics as a convenient model for many objects, such as smooth frames for rectangular things. One quarter of a supertoroid can provide a smooth and seamless 90-degree joint between two superquadric [cylinders](/source/Cylinder_(geometry)). However, they are not [algebraic surfaces](/source/Algebraic_surface) (except in special cases).

## Formulas

Alan Barr's supertoroids are defined by parametric equations similar to the [trigonometric](/source/Trigonometry) equations of the torus, except that the [sine](/source/Sine) and [cosine](/source/Cosine) terms are raised to arbitrary [powers](/source/Exponentiation). Namely, the generic point *P*(*u*, *v*) of the surface is given by P ( u , v ) = ( X ( u , v ) Y ( u , v ) Z ( u , v ) ) = ( ( a + C u s ) C v t ( b + C u s ) S v t S u s ) {\displaystyle P(u,v)=\left({\begin{array}{c}X(u,v)\\Y(u,v)\\Z(u,v)\end{array}}\right)=\left({\begin{array}{c}(a+C_{u}^{s})C_{v}^{t}\\(b+C_{u}^{s})S_{v}^{t}\\S_{u}^{s}\end{array}}\right)} where C θ ε = sgn ⁡ ( cos ⁡ θ ) | cos ⁡ θ | ε , S θ ε = sgn ⁡ ( sin ⁡ θ ) | sin ⁡ θ | ε , {\displaystyle {\begin{aligned}C_{\theta }^{\varepsilon }&=\operatorname {sgn} (\cos \theta )\,\left|\,\cos \theta \,\right|^{\varepsilon },\\S_{\theta }^{\varepsilon }&=\operatorname {sgn} (\sin \theta )\ \left|\,\sin \theta \ \right|^{\varepsilon },\end{aligned}}} sgn is the [sign function](/source/Sign_function), and the parameters u, v range from 0 to 360 degrees (0 to 2*π* [radians](/source/Radian)).

In these formulas, the parameter *s* > 0 controls the "squareness" of the vertical sections, *t* > 0 controls the squareness of the horizontal sections, and *a*, *b* ≥ 1 are the major radii in the x and y directions. With *s* = *t* = 1 and *a* = *b* = *R* one obtains the ordinary torus with major radius R and minor radius 1, with the center at the origin and [rotational symmetry](/source/Symmetry) about the z-axis.

In general, the supertorus defined as above spans the [intervals](/source/Interval_(mathematics)): − ( a + 1 ) ≤ x ≤ + ( a + 1 ) − ( b + 1 ) ≤ y ≤ + ( b + 1 ) − 1 ≤ z ≤ + 1 {\displaystyle {\begin{array}{rcccl}-(a+1)&\leq &x&\leq &+(a+1)\\[4pt]-(b+1)&\leq &y&\leq &+(b+1)\\[4pt]-1&\leq &z&\leq &+1\end{array}}} The whole shape is symmetric about the planes *x* = 0, *y* = 0, and *z* = 0. The hole runs in the z direction and spans the intervals − ( a − 1 ) ≤ x ≤ + ( a − 1 ) − ( b − 1 ) ≤ y ≤ + ( b − 1 ) − ∞ ≤ z ≤ + ∞ {\displaystyle {\begin{array}{rcccl}-(a-1)&\leq &x&\leq &+(a-1)\\[4pt]-(b-1)&\leq &y&\leq &+(b-1)\\[4pt]-\infty &\leq &z&\leq &+\infty \end{array}}}

A curve of constant u on this surface is a horizontal [Lamé curve](/source/Lam%C3%A9_curve) with exponent ⁠ 2 t , {\displaystyle {\tfrac {2}{t}},} ⁠ scaled in x and y and displaced in z. A curve of constant v, projected on the plane *x* = 0 or *y* = 0, is a Lamé curve with exponent ⁠ 2 s , {\displaystyle {\tfrac {2}{s}},} ⁠ scaled and horizontally shifted. If *v* = 0, the curve is planar and spans the intervals: a − 1 ≤ x ≤ a + 1 − 1 ≤ z ≤ + 1 {\displaystyle {\begin{array}{rcccl}a-1&\leq &x&\leq &a+1\\[4pt]-1&\leq &z&\leq &+1\end{array}}} and similarly if *v* = 90°, 180°, 270°. The curve is also planar if *a* = *b*.

In general, if *a* ≠ *b* and v is not a multiple of 90 degrees, the curve of constant v will not be planar; and, conversely, a vertical plane section of the supertorus will not be a Lamé curve.

The basic supertoroid shape defined above is often modified by non-uniform scaling to yield supertoroids of specific width, length, and vertical thickness.

## Plotting code

The following [GNU Octave](/source/GNU_Octave) code generates plots of a supertorus:

 function supertoroid(epsilon,a)
  n=50;
  d=.1;
  etamax=pi;
  etamin=-pi;
  wmax=pi;
  wmin=-pi;
  deta=(etamax-etamin)/n;
  dw=(wmax-wmin)/n;
  k=0;
  l=0;
  for i=1:n+1
    eta(i)=etamin+(i-1)*deta;
    for j=1:n+1
      w(j)=wmin+(j-1)*dw;
      x(i,j)=a(1)*(a(4)+sign(cos(eta(i)))*abs(cos(eta(i)))^epsilon(1))*sign(cos(w(j)))*abs(cos(w(j)))^epsilon(2);
      y(i,j)=a(2)*(a(4)+sign(cos(eta(i)))*abs(cos(eta(i)))^epsilon(1))*sign(sin(w(j)))*abs(sin(w(j)))^epsilon(2);
      z(i,j)=a(3)*sign(sin(eta(i)))*abs(sin(eta(i)))^epsilon(1);
    endfor;
  endfor;
   mesh(x,y,z);
 endfunction;

## See also

- [Superellipsoid](/source/Superellipsoid)

- [Superegg](/source/Superegg)

- [Superquadric](/source/Superquadric)

## References

1. **[^](#cite_ref-barr_1-0)** Alan H. Barr (1981) *Superquadrics and Angle-Preserving Transformations*. IEEE Computer Graphics and Applications, volume 1 issue 1. pp. 11-23.

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