Torus

Author

Eric W. Weisstein
October 22, 2021

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Surfaces/Torus.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Torus.html.

©2021 Wolfram Research, Inc. except for portions noted otherwise

Definitions

ent="SolidTorus";

var=SolidData[ent,"Variables"]

parm=SolidData[ent,"Parameters"]

ineq=(SolidData[ent,"Inequalities"]@@var)@@parm

implreg=SolidData[ent,"ImplicitRegion"]@@var

reg=SolidData[ent,"Region"]@@var

assum=SolidData[ent,"VariableConstraints"]@@var

vol=SolidData[ent,"Volume"]@@var

Plots

Built-in Torus

$Version

Graphics3D[Torus[]]

Built-in FilledTorus

$Version

Graphics3D[FilledTorus[]]

Entity Image

Show[SolidData[ent,"Image"],ImageSize->Small,Method->{"ShrinkWrap"->True}]

Entity ImplicitRegion

Show[DiscretizeRegion@SolidData[ent,"ImplicitRegion"][.2,1],Method->{"ShrinkWrap"->True},ImageSize->Small]

Entity ParametricRegion

SolidData["SolidTorus","ParametricRegion"][.2,1]

TimeConstrained[DiscretizeRegion@SolidData["SolidTorus","ParametricRegion"][.2,1],60]//Timing

Show[DiscretizeRegion@SolidData[ent,"ParametricRegion"][.2,1],Method->{"ShrinkWrap"->True},ImageSize->Small]

bug(295866)

Entity Region

Show[DiscretizeRegion@SolidData[ent,"Region"][.2,1],Method->{"ShrinkWrap"->True},ImageSize->Small]

DiscretizeRegion

Block[{a=1/2,c=1},Show[DiscretizeRegion[reg],Method->{"ShrinkWrap"->True},ImageSize->Small]]

ContourPlot3D

Block[{a=.2,c=1},ContourPlot3D[(c-Sqrt[x^2+y^2])^2+z^2==a^2,{x,-(a+c),a+c},{y,-(a+c),a+c},{z,-a,a},BoxRatios->Automatic,Boxed->False,Axes->False,ImageSize->Small,Method->{"ShrinkWrap"->True}]]

RegionPlot3D

Block[{a=.2,c=1},RegionPlot3D[(c-Sqrt[x^2+y^2])^2+z^2<=a^2,{x,-a-c,a+c},{y,-a-c,a+c},{z,-a,a},BoxRatios->Automatic,Axes->False,Boxed->False,ImageSize->Small,Method->{"ShrinkWrap"->True}]]

RevolutionPlot3D

Block[{a=.2,c=1},RevolutionPlot3D[{(c+a Cos[v]) Cos[u],(c+a Cos[v]) Sin[u],a Sin[v]},{u,0,2π},{v,0,2π},Mesh->False,ImageSize->Small,Method->{"ShrinkWrap"->True}]]

Regions

SolidData[ent,"ImplicitRegion"]

SolidData[ent,"ParametricRegion"]

SolidData[ent,"Region"]

RegionQ[FilledTorus[]]

$Version

bug(415952): RegionPlot3D[Torus[]] displays with inconsistent mesh edges

RegionPlot3D[Torus[]]

$Version

bug(415953): RegionPlot3D[FilledTorus[]] is empty

RegionPlot3D/@{FilledTorus[],Ball[]}

Equations

Cartesian

GroebnerBasis[Join[Thread[{x,y,z}=={(c+a Cos[v])Cos[u],(c+a Cos[v])Sin[u],a Sin[v]}],Cos[#]^2+Sin[#]^2==1&/@{u,v}],{x,y,z},{Cos[u],Cos[v],Sin[u],Sin[v]},MonomialOrder->EliminationOrder]

Factor[gb[[1]]]

Expand[(((c-(Sqrt[(x^2)+(y^2)])))^2)]==(a^2)-(z^2)

Factor[Expand[((((c^2)+(x^2)+(y^2)-((a^2)-(z^2))))^2)-(((2 c (Sqrt[(x^2)+(y^2)])))^2)]]

eqn=(a^4)-2 (a^2) (c^2)+(c^4)-2 (a^2) (x^2)-2 (c^2) (x^2)+(x^4)-2 (a^2) (y^2)-2 (c^2) (y^2)+2 (x^2) (y^2)+(y^4)-2 (a^2) (z^2)+2 (c^2) (z^2)+2 (x^2) (z^2)+2 (y^2) (z^2)+(z^4);

AlgebraicDegree[eqn,{x,y,z}]

Curvatures

ParametricPlot3D[Evaluate[Join[torus[1.,.2],{FaceForm[Hue[u/2/Pi]]}]],{u,0,2π},{v,0,2π},Boxed->False,Axes->False,Lighting->False]

ParametricPlot3D[Evaluate[Join[torus[1.,.2],{FaceForm[Hue[v/2/Pi]]}]],{u,0,2π},{v,0,2π},Boxed->False,Axes->False,Lighting->False]

Solve[-((c+2 a Cos[v])/(2 a (c+a Cos[v])))==0,v]

ArcCos[-.2/2/1.]

FindRoot[-((c+2 a Cos[v])/(2 a (c+a Cos[v])))/.{a->1.,c->.2},{v,1.7}]

-((c+2 a Cos[v])/(2 a (c+a Cos[v])))/.{a->1.,c->.2,v->1.77}

Plot[Evaluate[-((c+2 a Cos[v])/(2 a (c+a Cos[v])))/.{a->1.,c->.8}],{v,0,2π}]

Plot[Evaluate[-((c+2 a Cos[v])/(2 a (c+a Cos[v])))/.{a->1.,c->.2}],{v,0,2π}]

ParametricPlot3D[Evaluate[Join[torus[a,c],{FaceForm[GrayLevel[1.4-((c+2 a Cos[v])/(2 a (c+a Cos[v])))]]}]/.{a->1.,c->.2}],{u,0,2π},{v,0,2π},Boxed->False,Axes->False,Lighting->False]

Embeddings

Block[{a=.2,c=1},ContourPlot3D[(c-Sqrt[x^2+y^2])^2+z^2==a^2,{x,-(a+c),a+c},{y,-(a+c),a+c},{z,-a,a},BoxRatios->Automatic]]

Block[{a=.2,c=1},RegionPlot3D[(c-Sqrt[x^2+y^2])^2+z^2<=a^2,{x,-a-c,a+c},{y,-a-c,a+c},{z,-a,a},BoxRatios->Automatic]]

Block[{a=.2,c=1},RevolutionPlot3D[{(c+a Cos[v]) Cos[u],(c+a Cos[v]) Sin[u],a Sin[v]},{u,0,2π},{v,0,2π}]]

Block[{a=.2,c=1},RevolutionPlot3D[{c+a Cos[t],a Sin[t]},{t,0,2π},Mesh->False]]

Properties

Curvatures

Curvatures[{(c+a Cos[v])Cos[u],(c+a Cos[v])Sin[u],a Sin[v]},{u,v}]

FullSimplify[MeanCurvature[{(c+a Cos[v])Cos[u],(c+a Cos[v])Sin[u],a Sin[v]},{u,v}],0<a<c&&0<v<2π]//Factor

FullSimplify[PrincipalCurvatures[{(c+a Cos[v])Cos[u],(c+a Cos[v])Sin[u],a Sin[v]},{u,v}],a>0&&b>0&&c>0&&(u|v)∈Reals]

Integrate[a(c+a Cos[v]),{u,0,2Pi},{v,0,2Pi}]

SortBy[FullSimplify[GaussianCurvature[eqn,{x,y,z}]],ByteCount]

ByteCount/@%

MeanCylindricalRadius

Integrate Cylindrical Coordinates

Assuming[assum,FullSimplify[(vol^(-1))Integrate[r Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞}]]]//Timing

(x,y,z)

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(Sqrt[(x^2)+(y^2)]),{x,y,z}∈SolidData[ent,"Region"][a,c]]]]//Timing

bug(295881)

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(Sqrt[(x^2)+(y^2)]),{x,y,z}∈SolidData[ent,"Region"][a,c],GenerateConditions->True]]]//Timing

Assuming[assum,Integrate[(Sqrt[(x^2)+(y^2)]),{x,y,z}∈SolidData[ent,"Region"][a,c],GenerateConditions->True]]//Timing

Assuming[assum,FullSimplify[%[[2]]]]

(x,z,y)

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(Sqrt[(x^2)+(y^2)]),{x,z,y}∈SolidData[ent,"Region"][a,c]]]]//Timing

(y,x,z)

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(Sqrt[(x^2)+(y^2)]),{y,x,z}∈SolidData[ent,"Region"][a,c]]]]//Timing

(y,z,x)

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(Sqrt[(x^2)+(y^2)]),{y,z,x}∈SolidData[ent,"Region"][a,c]]]]//Timing

Cylindrical Coordinates

Assuming[assum,FullSimplify[(vol^(-1))Integrate[r Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞}]]]//Timing

MeanSphericalRadius

Cartesian

$Version

Assuming[assum,Integrate[(Sqrt[(x^2)+(y^2)+(z^2)]),{x,y,z}∈reg]]//Timing

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(Sqrt[(x^2)+(y^2)+(z^2)]),{x,y,z}∈reg]]]//Timing

Cylindrical

$Version

Assuming[assum,Integrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞}]]//Timing

Assuming[assum,Integrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{r,0,∞},{z,-∞,∞}]]//Timing

Older:

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞}]]]//Timing

(vol^(-1))Integrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞},Assumptions->0<a<c]//Timing

(vol^(-1))Integrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞},Assumptions->0<a<c,GenerateConditions->True]//Timing

(vol^(-1))Integrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{r,0,a+c},{z,-a,a},Assumptions->0<a<c,GenerateConditions->True]//Timing

InputForm[Last[%22]]

Piecewise[{{(22*a^3*c*Sqrt[a^2 + c^2] + 7*a*c^3*Sqrt[a^2 + c^2] + 
      (8*I)*a^5*EllipticE[(a + c)^2/(a - c)^2] - (8*I)*a^4*c*EllipticE[(a + c)^2/(a - c)^2] + 
      (112*I)*a^3*c^2*EllipticE[(a + c)^2/(a - c)^2] - (112*I)*a^2*c^3*
       EllipticE[(a + c)^2/(a - c)^2] + (8*I)*a*c^4*EllipticE[(a + c)^2/(a - c)^2] - 
      (8*I)*c^5*EllipticE[(a + c)^2/(a - c)^2] - 
      (8*I)*a^5*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (8*I)*a^4*c*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (112*I)*a^3*c^2*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (112*I)*a^2*c^3*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (8*I)*a*c^4*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (8*I)*c^5*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (16*I)*a^4*c*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (112*I)*a^3*c^2*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (112*I)*a^2*c^3*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (16*I)*a*c^4*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (16*I)*a^4*c*EllipticK[(a + c)^2/(a - c)^2] - (112*I)*a^3*c^2*
       EllipticK[(a + c)^2/(a - c)^2] + (112*I)*a^2*c^3*EllipticK[(a + c)^2/(a - c)^2] - 
      (16*I)*a*c^4*EllipticK[(a + c)^2/(a - c)^2] + 
      60*c*Integrate[r*(Sqrt[(a^2 - c*(c - 2*r))*(a^2 - (c - r)^2)] - r^2*Log[r] + 
          r^2*Log[Sqrt[a^2 - (c - r)^2] + Sqrt[a^2 - c^2 + 2*c*r]]), {r, -a + c, c}, 
        Assumptions -> a > 0 && a - c < 0, GenerateConditions -> True] + 15*c^5*Log[c] - 
      15*c^5*Log[a + Sqrt[a^2 + c^2]])/(60*c), a > 0 && a - c < 0}}, 
  Integrate[r*Sqrt[r^2 + z^2]*Boole[(c - r)^2 + z^2 < a^2], {r, 0, a + c}, {z, -a, a}, 
   Assumptions -> a > 0 && a - c < 0 && a + c > 0 && c <= 0, GenerateConditions -> True]]/
 (a^2*c*Pi)

(22*a^3*c*Sqrt[a^2 + c^2] + 7*a*c^3*Sqrt[a^2 + c^2] + 
      (8*I)*a^5*EllipticE[(a + c)^2/(a - c)^2] - (8*I)*a^4*c*EllipticE[(a + c)^2/(a - c)^2] + 
      (112*I)*a^3*c^2*EllipticE[(a + c)^2/(a - c)^2] - (112*I)*a^2*c^3*
       EllipticE[(a + c)^2/(a - c)^2] + (8*I)*a*c^4*EllipticE[(a + c)^2/(a - c)^2] - 
      (8*I)*c^5*EllipticE[(a + c)^2/(a - c)^2] - 
      (8*I)*a^5*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (8*I)*a^4*c*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (112*I)*a^3*c^2*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (112*I)*a^2*c^3*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (8*I)*a*c^4*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (8*I)*c^5*EllipticE[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (16*I)*a^4*c*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (112*I)*a^3*c^2*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] - 
      (112*I)*a^2*c^3*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (16*I)*a*c^4*EllipticF[ArcSin[Sqrt[a^2 + c^2]/(a + c)], (a + c)^2/(a - c)^2] + 
      (16*I)*a^4*c*EllipticK[(a + c)^2/(a - c)^2] - (112*I)*a^3*c^2*
       EllipticK[(a + c)^2/(a - c)^2] + (112*I)*a^2*c^3*EllipticK[(a + c)^2/(a - c)^2] - 
      (16*I)*a*c^4*EllipticK[(a + c)^2/(a - c)^2] + 
      60*c*Integrate[r*(Sqrt[(a^2 - c*(c - 2*r))*(a^2 - (c - r)^2)] - r^2*Log[r] + 
          r^2*Log[Sqrt[a^2 - (c - r)^2] + Sqrt[a^2 - c^2 + 2*c*r]]), {r, -a + c, c}, 
        Assumptions -> a > 0 && a - c < 0, GenerateConditions -> True] + 15*c^5*Log[c] - 
      15*c^5*Log[a + Sqrt[a^2 + c^2]])/(60*c)

Integrate[r*(Sqrt[(a^2 - c*(c - 2*r))*(a^2 - (c - r)^2)] - r^2*Log[r] + 
          r^2*Log[Sqrt[a^2 - (c - r)^2] + Sqrt[a^2 - c^2 + 2*c*r]]), {r, -a + c, c}, 
        Assumptions -> a > 0 && a - c < 0, GenerateConditions -> True]

Integrate[r ((Sqrt[((a^2)-c (c-2 r)) ((a^2)-(((c-r))^2))])-(r^2) Log[r]+(r^2) Log[(Sqrt[(a^2)-(((c-r))^2)])+(Sqrt[(a^2)-(c^2)+2 c r])]),{r,-a+c,c},Assumptions->a>0&&a-c<0]//Timing

With[{a=1,c=2},(1/(2 (a^2) c (π^2)))NIntegrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-a,a},{r,0,a+c}]]

With[{a=1,c=2},(vol^(-1))Integrate[(Sqrt[(r^2)+(z^2)]) Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-a,a},{r,0,a+c}]]//Timing

N[Last[%]]

Spherical

(vol^(-1))Integrate[r Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]](r^2)Sin[ϕ],{r,0,∞},{θ,0,2π},{ϕ,0,π},Assumptions->0<a<c]//Timing

(vol^(-1))Integrate[r Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]](r^2)Sin[ϕ],{r,0,a+c},{ϕ,0,π},Assumptions->0<a<c]//Timing

MeanSquareCylindricalRadius

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(x^2)+(y^2),{x,y,z}∈SolidData[ent,"Region"][a,c]]]]//Timing

bug(295881)

Integrate Cylindrical Coordinates

Assuming[assum,FullSimplify[(vol^(-1))Integrate[(r^2)Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞}]]]//Timing

MeanSquareSphericalRadius

$Version

Assuming[assum,Integrate[(x^2)+(y^2)+(z^2),{x,y,z}∈reg]]//Timing

Integrate Cylindrical Coordinates

(1/(2 (a^2) c (π^2)))Integrate[((r^2)+(z^2))Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞},Assumptions->0<a<c]//Timing

Integrate Spherical Coordinates

(1/(2 (a^2) c (π^2)))Integrate[(r^(2 ))Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]](r^2)Sin[ϕ],{r,0,∞},{θ,0,2π},{ϕ,0,π},Assumptions->0<a<c]//Timing

SurfaceArea

Built-in

$Version

SurfaceArea[FilledTorus[{0,0,0},{c-a,c+a}]]

SurfaceArea[FilledTorus[{x,y,z},{c-a,c+a}]]

Area[Torus[{0,0,0},{c-a,c+a}]]

Area[Torus[{x,y,z},{c-a,c+a}]]

Volume

Entity

SolidData[ent,"Volume"]

Built-in

$Version

Volume[FilledTorus[{0,0,0},{c-a,c+a}]]

Volume[FilledTorus[{x,y,z},{c-a,c+a}]]

Plot

With[{c=1,a=.2},RegionPlot3D[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2),{x,-1.5,1.5},{y,-1.5,1.5},{z,-.3,.3},Boxed->False,Axes->False,BoxRatios->Automatic]]

JacobianMatrix[fns_List,vars_List]:=Outer[D,fns,vars]

FullSimplify[Det@JacobianMatrix[{(c+rr Cos [v])Cos[u],(c+rr Cos[v])Sin[u],rr Sin[v]},{rr,u,v}]]

Integrate[rr (c+rr Cos[v]),{rr,0,a},{u,0,2π},{v,0,2π}]

<<Graphics`InequalityGraphics`

With[{a=1,c=2},InequalityPlot3D[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2),{x},{y},{z},PlotPoints->20]]

With[{a=1,c=2},InequalityPlot3D[(a^4)-2 (a^2) (c^2)+(c^4)-2 (a^2) (x^2)-2 (c^2) (x^2)+(x^4)-2 (a^2) (y^2)-2 (c^2) (y^2)+2 (x^2) (y^2)+(y^4)-2 (a^2) (z^2)+2 (c^2) (z^2)+2 (x^2) (z^2)+2 (y^2) (z^2)+(z^4)<0,{x},{y},{z},PlotPoints->20]]

With[{a=1,c=2},InequalityPlot3D[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)&&x>0,{x},{y},{z},PlotPoints->20]]

With[{a=1,c=1},RegionPlot3D[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2),{x,-2,2},{y,-2,2},{z,-1,1},BoxRatios->Automatic]]

Boole

v5.2

Integrate[Boole[(a^4)-2 (a^2) (c^2)+(c^4)-2 (a^2) (x^2)-2 (c^2) (x^2)+(x^4)-2 (a^2) (y^2)-2 (c^2) (y^2)+2 (x^2) (y^2)+(y^4)-2 (a^2) (z^2)+2 (c^2) (z^2)+2 (x^2) (z^2)+2 (y^2) (z^2)+(z^4)<0],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->0<a<c]//Timing

(v=Integrate[Boole[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->0<a<c])//Timing

Simplify[v,0<a<c]//Timing

v6

(v=Integrate[Boole[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->0<a<c])//Timing

Simplify[v,0<a<c]

v6 with Assuming

(v=Assuming[0<a<c,Integrate[Boole[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞}]//Simplify])//Timing

(v2=Refine[(Piecewise[{{2 (Integrate[(Sqrt[(a^2)-(c^2)-(x^2)-(y^2)+2 c (Sqrt[(x^2)+(y^2)])]),{x,-(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])]),(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])])},{y,(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])-(x^2)]),(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])-(x^2)])},Assumptions->a>0&&a-c<0&&(Sqrt[(a^2)])-c<0]+Integrate[(Sqrt[(a^2)-(c^2)-(x^2)-(y^2)+2 c (Sqrt[(x^2)+(y^2)])]),{x,-(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])]),(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])])},{y,-(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])-(x^2)]),-(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])-(x^2)])},Assumptions->a>0&&a-c<0&&(Sqrt[(a^2)])-c<0]+Integrate[(Sqrt[(a^2)-(c^2)-(x^2)-(y^2)+2 c (Sqrt[(x^2)+(y^2)])]),{x,(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])]),(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])])},{y,-(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])-(x^2)]),(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])-(x^2)])},Assumptions->a>0&&a-c<0&&(Sqrt[(a^2)])-c<0]+Integrate[(Sqrt[(a^2)-(c^2)-(x^2)-(y^2)+2 c (Sqrt[(x^2)+(y^2)])]),{x,-(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])]),-(Sqrt[(a^2)+(c^2)-2 (Sqrt[(a^2) (c^2)])])},{y,-(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])-(x^2)]),(Sqrt[(a^2)+(c^2)+2 (Sqrt[(a^2) (c^2)])-(x^2)])},Assumptions->a>0&&a-c<0&&(Sqrt[(a^2)])-c<0]), a>0&&(Sqrt[(a^2)])-c<0}}]),0<a<c])//Timing

Integrate[(Sqrt[(a^2)-(c^2)-(x^2)-(y^2)+2 c (Sqrt[(x^2)+(y^2)])]),{x,-(Sqrt[(a^2)-2 a c+(c^2)]),(Sqrt[(a^2)-2 a c+(c^2)])},{y,(Sqrt[(a^2)-2 a c+(c^2)-(x^2)]),(Sqrt[(a^2)+2 a c+(c^2)-(x^2)])},Assumptions->0<a<c]

Integrate[(Sqrt[(a^2)-(c^2)-(x^2)-(y^2)+2 c (Sqrt[(x^2)+(y^2)])]),{x,-(Sqrt[(a^2)-2 a c+(c^2)]),(Sqrt[(a^2)-2 a c+(c^2)])},{y,(Sqrt[(a^2)-2 a c+(c^2)-(x^2)]),(Sqrt[(a^2)+2 a c+(c^2)-(x^2)])},GenerateConditions->False]

V6.1

eqn=(a^4)-2 (a^2) (c^2)+(c^4)-2 (a^2) (x^2)-2 (c^2) (x^2)+(x^4)-2 (a^2) (y^2)-2 (c^2) (y^2)+2 (x^2) (y^2)+(y^4)-2 (a^2) (z^2)+2 (c^2) (z^2)+2 (x^2) (z^2)+2 (y^2) (z^2)+(z^4)<1;

eqn2=(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2);

{x,y,z}

(v=Integrate[Boole[eqn],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->0<a<c])//Timing

(v=Integrate[Boole[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->0<a<c])//Timing

{x,z,y}

(v=Integrate[Boole[eqn],{x,-∞,∞},{z,-∞,∞},{y,-∞,∞},Assumptions->0<a<c])//Timing

{y,x,z}

(v=Integrate[Boole[eqn],{y,-∞,∞},{x,-∞,∞},{z,-∞,∞},Assumptions->0<a<c])//Timing

{y,z,x}

(v=Integrate[Boole[eqn],{y,-∞,∞},{z,-∞,∞},{x,-∞,∞},Assumptions->0<a<c])//Timing

{z,x,y}

(v=Integrate[Boole[eqn],{z,-∞,∞},{x,-∞,∞},{y,-∞,∞},Assumptions->0<a<c])//Timing

{z,y,x}

(v=Integrate[Boole[eqn],{z,-∞,∞},{y,-∞,∞},{x,-∞,∞},Assumptions->0<a<c])//Timing

(v=Integrate[Boole[eqn2],{z,-∞,∞},{y,-∞,∞},{x,-∞,∞},Assumptions->0<a<c])//Timing

(v=Assuming[0<a<c,Integrate[Boole[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)],{z,-∞,∞},{y,-∞,∞},{x,-∞,∞}]//Simplify])//Timing

...crash...

V8

$Version

eqn=(a^4)-2 (a^2) (c^2)+(c^4)-2 (a^2) (x^2)-2 (c^2) (x^2)+(x^4)-2 (a^2) (y^2)-2 (c^2) (y^2)+2 (x^2) (y^2)+(y^4)-2 (a^2) (z^2)+2 (c^2) (z^2)+2 (x^2) (z^2)+2 (y^2) (z^2)+(z^4)<1;

(i=Integrate[Boole[eqn],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->0<a<c])//Timing

FullSimplify[i,0<a<c]

$Version

(v=Assuming[0<a<c,Integrate[Boole[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)],{z,-∞,∞},{y,-∞,∞},{x,-∞,∞}]//Simplify])//Timing

FullSimplify[v,0<a<c]

Cylindrical

FullSimplify[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)/.{x->r Cos[θ],y->r Sin[θ]},r>0&&0<θ<2π]

Integrate[Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞},Assumptions->0<a<c]//Timing

FullSimplify[(2/3) (2 (a^2) (Sqrt[(a^2)-(c^2)]) π+(c^2) (Sqrt[(a^2)-(c^2)]) π+3 (a^2) c π ArcCot[(c/(Sqrt[(a^2)-(c^2)]))]+6 (a^2) c π ArcSec[(a/(Sqrt[(a^2)-(c^2)]))]),0<a<c]

Spherical

FullSimplify[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)/.{x->r Cos[θ]Sin[ϕ],y->r Sin[θ]Sin[ϕ],z->r Cos[ϕ]},r>0&&0<ϕ<π]

Integrate[Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]](r^2)Sin[ϕ],{θ,0,2π},{ϕ,0,π},{r,0,∞},Assumptions->0<a<c]//Timing

Integrate[Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]](r^2)Sin[ϕ],{r,0,∞},{θ,0,2π},{ϕ,0,π},Assumptions->0<a<c]//Timing

RegionMeasure

Assuming[assum,RegionMeasure[reg]]//Timing

Centroid

Entity

SolidData[ent,"Centroid"]

Built-in

RegionCentroid[Torus[]]

RegionCentroid[FilledTorus[]]

RegionCentroid[FilledTorus[{x,y,z},{c-a,c+a}]]

Cartesian

Cylindrical

Integrate[Boole[(((c-r))^2)+(z^2)<(a^2)]r{r Cos[θ],r Sin[θ],z},{θ,0,2π},{z,-∞,∞},{r,0,∞},Assumptions->a>0&&c>0]//Timing

Spherical

Integrate[Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]](r^2)Sin[ϕ]{r Cos[θ]Sin[ϕ],r Sin[θ]Sin[ϕ],r Cos[ϕ]},{θ,0,2π},{ϕ,0,π},{r,0,∞},Assumptions->a>0&&c>0]//Timing

Integrate[Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]](r^2)Sin[ϕ]{r Cos[θ]Sin[ϕ],r Sin[θ]Sin[ϕ],r Cos[ϕ]},{r,0,∞},{θ,0,2π},{ϕ,0,π},Assumptions->a>0&&c>0]//Timing

RegionCentroid

Assuming[assum,RegionCentroid[reg]]//Timing

Centroid

(x,y,z)

(xx=Integrate[x Boole[(((c-(Sqrt[(x^2)+(y^2)])))^2)<(a^2)-(z^2)&&x>0],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->0<a<c])//Timing

xbar=(xx/(2 (a^2) c (π^2)))

Inertia Tensor

Built-in

MomentOfInertia[FilledTorus[]]

MomentOfInertia[FilledTorus[{x,y,z},{c-a,c+a}]]

MomentOfInertia[FilledTorus[{x,y,z},{c-a,c+a}]]

Entity

Entity["Solid","SolidTorus"]["InertiaTensor"][a,c]

Cylindrical

i=FullSimplify[{{y^2+z^2,-x y,-x z},
{-x y,z^2+x^2,-y z},
{-x z,-y z,x^2+y^2}}/.{x->r Cos[θ],y->r Sin[θ]}]

InertiaTensor[{r,θ,z},"CoordinateSystem"->"Cylindrical"]

GenerateConditions -> Automatic

With[{ρ=(M/(2 (a^2) c (π^2)))},ρ Integrate[i Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞},Assumptions->a>0&&c>0]]//Timing

i=Last[%];

FullSimplify[i,0<a<c]

{{(5a^2/8+c^2/2),0,0},{0,(5a^2/8+c^2/2),0},{0,0,(3a^2/4+c^2)}}

FullSimplify[i,0<c<a]

Limit[i,c->a]

GenerateConditions -> True

With[{ρ=(M/(2 (a^2) c (π^2)))},ρ Integrate[InertiaTensor[{r,θ,z},"CoordinateSystem"->"Cylindrical"] Boole[(((c-r))^2)+(z^2)<(a^2)]r,{θ,0,2π},{z,-∞,∞},{r,0,∞},Assumptions->a>0&&c>0,GenerateConditions->True]]//Timing

FullSimplify[Last[%],0<a<c]

Spherical

i=FullSimplify[{{y^2+z^2,-x y,-x z},
{-x y,z^2+x^2,-y z},
{-x z,-y z,x^2+y^2}}/.{x->r Cos[θ]Sin[ϕ],y->r Sin[θ]Sin[ϕ],z->r Cos[ϕ]}]

With[{ρ=(M/(2 (a^2) c (π^2)))},ρ Integrate[i Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]]r^2 Sin[ϕ],
{θ,0,2π},{ϕ,0,π},{r,0,∞},Assumptions->a>0&&c>0]]//Timing

With[{ρ=(M/(2 (a^2) c (π^2)))},ρ Integrate[i Boole[(c^2)+(r^2)<(a^2)+2 c r Sin[ϕ]]r^2 Sin[ϕ],
{r,0,∞},{θ,0,2π},{ϕ,0,π},Assumptions->a>0&&c>0]]//Timing

...crash...

Torus Dissection

Solve[{(2Sqrt[2]+y)^2==3^2+x^2,x^2==1+y^2},{x,y}]

Solve[{1==h^2+x1^2,y^2==h^2+(x-x1)^2} /. {x->3/2/Sqrt[2],y->1/2/Sqrt[2]},{h,x1}]

θ=ArcSin[1/3];

{Cos[θ],Sin[θ]}

p=FullSimplify[{3,3}-{Cos[θ],Sin[θ]}Sqrt[3^2-1^2]]

x=3/2/Sqrt[2];
y=1/2/Sqrt[2];
h=1/3;
x1=2Sqrt[2]/3;

p2=FullSimplify[{3,3}-{Cos[θ],Sin[θ]}(2Sqrt[2]-1)]

Show[Graphics[{
Line[{{0,0},{3,0},{3,3},{0,3},{0,0}}],
Line[{{x,0},{0,3}}],
Line[{{3,3},p}],
Polygon[{{0,0},{x,0},{x1,h}}],
Polygon[{p,{0,3},{x,3},p2}]
},AspectRatio->Automatic]]

Threaded Torus

<<Utilities`POVRay`

Torus

POVCoefficients[r^4-2*r^2*R^2+R^4-2*r^2*x^2-2*R^2*x^2+x^4-2*r^2*y^2+2*R^2*y^2+2*x^2*y^2+y^4-2*r^2*z^2-2*R^2*z^2+2*x^2*z^2+2*y^2*z^2+z^4/. {r->1,R->3}]

With[{r=1,R=3},ContourPlot3D[r^4-2*r^2*R^2+R^4-2*r^2*x^2-2*R^2*x^2+x^4-2*r^2*y^2+2*R^2*y^2+2*x^2*y^2+y^4-2*r^2*z^2-2*R^2*z^2+2*x^2*z^2+2*y^2*z^2+z^4==0,{x,-4,4},{y,-4,4},{z,-4,4}]
]

Metric Properties

Metric Tensor

MetricTensor[{(c+a Cos[v])Cos[u],(c+a Cos[v])Sin[u],a Sin[v]},{u,v}]//FullSimplify

Christoffel Symbol of the Second Kind

FullSimplify[ChristoffelSymbols[{(c+a Cos[v])Cos[u],(c+a Cos[v])Sin[u],a Sin[v]},{u,v}],a>0&&c>0]

FullSimplify[ChristoffelSymbols2[{(c+a Cos[v])Cos[u],(c+a Cos[v])Sin[u],a Sin[v]},{u,v}],a>0&&c>0]

Vector Properties

eqn={(c+a Cos[v]) Cos[u],(c+a Cos[v]) Sin[u],a Sin[v]};
rules={Abs[x_]^(n_/;Mod[n,2]==0):>x^n};
assum=a>0&&c>0&&0<u<2π&&0<v<2π;

Vector Length

Assuming[assum,FullSimplify[Norm[eqn]/.rules]]

Normal Vector

Assuming[assum,FullSimplify[NormalVector[eqn,{u,v}]/.rules]]