Null graph: Difference between revisions
en>PaulTanenbaum m Corrected punctuation of "order-zero graph." |
en>Nbarth m →Order-zero graph: formatting |
||
Line 1: | Line 1: | ||
[[File:Ex_sq.png|right|320px|thumb|Some superquadrics.]] | |||
In [[mathematics]], the '''superquadrics''' or '''super-quadrics''' (also '''superquadratics''') are a family of [[geometry|geometric shapes]] defined by formulas that resemble those of [[elipsoid]]s and other [[quadric]]s, except that the [[square (algebra)|squaring]] operations are replaced by arbitrary powers. They can be seen as the three-dimensional relatives of the [[Lamé curve]]s ("[[Superellipse]]s"). | |||
The superquadrics include many shapes that resemble [[cube]]s, [[octahedron|octahedra]], [[Cylinder (geometry)|cylinders]], [[lozenge]]s and [[spindle torus|spindle]]s, with rounded or sharp corners. Because of their flexibility and relative simplicity, they are popular [[geometric model]]ing tools, especially in [[computer graphics]]. | |||
Some authors, such as [[Alan H. Barr|Alan Barr]], define "superquadrics" as including both the [[superellipsoid]]s and the [[supertoroid]]s.<ref name="barr81">Barr, A.H. (January 1981), ''Superquadrics and Angle-Preserving Transformations''. IEEE_CGA vol. 1 no. 1, pp. 11–23</ref><ref name="barr92">Barr, A.H. (1992), ''Rigid Physically Based Superquadrics''. Chapter III.8 of ''Graphics Gems III'', edited by D. Kirk, pp. 137–159</ref> However, the (proper) supertoroids are not superquadrics as defined above; and, while some superquadrics are superellipsoids, neither family is contained in the other. | |||
== Formulas == | |||
=== Implicit equation === | |||
The basic superquadric has the formula | |||
:<math> \left|x\right|^r + \left|y\right|^s + \left|z\right|^t =1</math> | |||
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 polygon|concave]] [[face (geometry)|faces]] and sharp [[edge (geometry)|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. | |||
* [[infinity (mathematics)|infinite]] (in the [[limit (mathematics)|limit]]): 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 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 [[similarity (geometry)|scaling]] this basic shape by different amounts ''A'', ''B'', ''C'' along each axis. Its general equation is | |||
:<math> \left|\frac{x}{A}\right|^r + \left|\frac{y}{B}\right|^s + \left|\frac{z}{C}\right|^t \leq 1</math> | |||
=== Parametric description === | |||
Parametric equations in terms of surface parameters ''u'' and ''v'' (longitude and latitude) are | |||
:<math>\begin{align} | |||
x(u,v) &{}= A c\left(v,\frac{2}{r}\right) c\left(u,\frac{2}{r}\right) \\ | |||
y(u,v) &{}= B c\left(v,\frac{2}{s}\right) s\left(u,\frac{2}{s}\right) \\ | |||
z(u,v) &{}= C s\left(v,\frac{2}{t}\right) \\ | |||
& -\frac{\pi}{2} \le v \le \frac{\pi}{2}, \quad -\pi \le u < \pi , | |||
\end{align}</math> | |||
where the auxiliary functions are | |||
:<math>\begin{align} | |||
c(\omega,m) &{}= \sgn(\cos \omega) |\cos \omega|^m \\ | |||
s(\omega,m) &{}= \sgn(\sin \omega) |\sin \omega|^m | |||
\end{align}</math> | |||
and the [[sign function]] sgn(''x'') is | |||
:<math> \sgn(x) = \begin{cases} | |||
-1, & x < 0 \\ | |||
0, & x = 0 \\ | |||
+1, & x > 0 . | |||
\end{cases}</math> | |||
<!-- Fix this for superquadrics: | |||
==Properties== | |||
===Volume and area=== | |||
The volume inside this surface can be expressed in terms of [[beta function]]s, β(''m'',''n'') = Γ(''m'')Γ(''n'')/Γ(''m''+''n''), as | |||
:<math> V = \frac{2}{3} A B C e n \beta \left( \frac{1}{r},\frac{1}{r} \right) \beta \left({2}{t},\frac{1}{t} \right) . </math> | |||
--> | |||
<!-- | |||
== Plots == | |||
[[Image:Sh.svg|right|thumb|320px|Superhyperboloids]] | |||
--> | |||
== Plotting code == | |||
The following [[GNU Octave]] code generates a mesh approximation of a superquadric: | |||
<!-- Is this code worth including? The equation is enough! --> | |||
<source lang="matlab"> | |||
function retval=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); | |||
endfunction; | |||
</source> | |||
<!--The hyperboloid images generated by this code are not very good. --> | |||
<!-- | |||
The following code plots superhyperboloids: | |||
<code> | |||
function superhyper(epsilon,a) | |||
n=50; | |||
d=.1; | |||
etamax=pi/2-d; | |||
etamin=-pi/2+d; | |||
wmax=3*pi/2-d; | |||
wmin=pi/2+d; | |||
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)*sign(sec(eta(i)))*abs(sec(eta(i)))^epsilon(1)*sign(sec(w(j)))*abs(sec(w(j)))^epsilon(2); | |||
y(i,j)=a(2)*sign(sec(eta(i)))*abs(sec(eta(i)))^epsilon(1)*sign(tan(w(j)))*abs(tan(w(j)))^epsilon(2); | |||
z(i,j)=a(3)*sign(tan(eta(i)))*abs(tan(eta(i)))^epsilon(1); | |||
endfor; | |||
endfor; | |||
mesh(x,y,z); | |||
endfunction; | |||
</code> | |||
--> | |||
== References == | |||
{{reflist}} | |||
*Jaklič, A., Leonardis, A., ''Solina, F., Segmentation and Recovery of Superquadrics''. Kluwer Academic Publishers, Dordrecht, 2000. | |||
== See also == | |||
* [[Quadric]] | |||
* [[Superellipse]] | |||
* [[Supertoroid]] | |||
* [[Superellipsoid]] | |||
* [[Superegg]] | |||
== External links == | |||
* [http://iris.usc.edu/Vision-Notes/bibliography/describe461.html Bibliography: SuperQuadric Representations] | |||
* [http://www.cs.utah.edu/~gk/papers/vissym04/ Superquadric Tensor Glyphs] | |||
* [http://www.gamedev.net/reference/articles/article1172.asp SuperQuadric Ellipsoids and Toroids, OpenGL Lighting, and Timing] | |||
* [http://demonstrations.wolfram.com/Superquadrics/ Superquadrics] by Robert Kragler, [[The Wolfram Demonstrations Project]]. | |||
* [https://github.com/pratikmallya/Superquad Superquadrics in Python] | |||
[[Category:Computer graphics]] |
Revision as of 17:03, 27 April 2013
In mathematics, the superquadrics or super-quadrics (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. They can be seen as the three-dimensional relatives of the Lamé curves ("Superellipses").
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.
Some authors, such as Alan Barr, define "superquadrics" as including both the superellipsoids and the supertoroids.[1][2] However, the (proper) supertoroids are not superquadrics as defined above; and, while some superquadrics are superellipsoids, neither family is contained in the other.
Formulas
Implicit equation
The basic superquadric has the formula
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. For example, if r=s=2, and t=4, one obtains a 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 this basic shape by different amounts A, B, C along each axis. Its general equation is
Parametric description
Parametric equations in terms of surface parameters u and v (longitude and latitude) are
where the auxiliary functions are
and the sign function sgn(x) is
Plotting code
The following GNU Octave code generates a mesh approximation of a superquadric:
function retval=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);
endfunction;
References
43 year old Petroleum Engineer Harry from Deep River, usually spends time with hobbies and interests like renting movies, property developers in singapore new condominium and vehicle racing. Constantly enjoys going to destinations like Camino Real de Tierra Adentro.
- Jaklič, A., Leonardis, A., Solina, F., Segmentation and Recovery of Superquadrics. Kluwer Academic Publishers, Dordrecht, 2000.