Cylinder

Author

Eric W. Weisstein
August 27, 2015

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

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

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

Comments

Need to combine Surfaces` and SolidGeometry` implementations

Definitions

ineq=x^2+y^2≤a^2&&-h/2≤z≤h/2;

reg=Cylinder[{{0,0,-h/2},{0,0,h/2}},a];

assum=a>0&&h>0;

vol=π (a^2)h;

ent="SolidCylinder";

Plots

DiscretizeRegion

Block[{a=1,h=2},Show[DiscretizeRegion[reg],ImageSize->Small]]

Entity Image

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

Entity ImplicitRegion

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

Entity ParametricRegion

DiscretizeRegion@SolidData[ent,"ParametricRegion"][1,1]

bug(296037)

Entity Region

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

RegionPlot3D

Block[{a=1,h=2},RegionPlot3D[ineq,{x,-a,a},{y,-a,a},{z,-h/2,h/2},Mesh->False,Boxed->False,BoxRatios->Automatic,Axes->None,ImageSize->Small]]

Graphics3D

Graphics3D[Cylinder[]]

Graphics3D[Cylinder[{{0,0,2},{1,1.4,1}},1]]

V5

Arbitrary Position

Show[Graphics3D[Cylinder[{0,0,2},{1,1.4,1},1]],Boxed->False]

LiveGraphics3D

<<Utilities`LiveGraphics3D`

WriteLiveForm[cylind1.m,Show[cylinder[1,2,20],opts]]

WriteLiveForm[cylind2.m,Show[cylinder[1,2,20,Caps->False],opts]]

Show[Graphics3D[{EdgeForm[],Cylinder[]}],Boxed->False]

Equations

GroebnerBasis[Append[Thread[{x,y,z}=={a Cos[v],a Sin[v],u}],Cos[v]^2+Sin[v]^2==1],{x,y,z},{u,Cos[v],Sin[v]},MonomialOrder->EliminationOrder]

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

Archimedes' Result

((Subscript[V, sphere])/((Subscript[V, circumscribed cylinder])-(Subscript[V, sphere])))==2

(((4/3)π (r^3))/(π (r^2)(2r)-(4/3)π (r^3)))

Graphics3D[{Opacity[.7],Sphere[],Cylinder[{{0,0,-1},{0,0,1}}]},Boxed->False]

RegionPlot3D[x^2+y^2<1&&x^2+y^2+z^2>1&&-1<z<1,{x,-1,1},{y,-1,1},{z,-1,1},PlotPoints->100,MaxRecursion->7,Boxed->False,Axes->False,PlotStyle->Opacity[.5],Mesh->None]

Oblique

Properties

Centroid

RegionCentroid

Assuming[assum,RegionCentroid[reg]]

Curvature

Curvatures[{a Cos[v],a Sin[v],u},{u,v}]

FullSimplify[PrincipalCurvatures[{a Cos[v],a Sin[v],u},{u,v}],a>0&&v∈Reals]

GaussianCurvature[x^2+y^2-a^2,{x,y,z}]

InertiaTensor

About base

InertiaTensor

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

i//TraditionalForm

(i=With[{ρ=(M/(π (a^2)h))},ρ Integrate[r InertiaTensor[{r,θ,z},"CoordinateSystem"->"Cylindrical"],{r,0,a},{θ,0,2π},{z,0,h},Assumptions->a>0&&h>0]]//Simplify)//Timing

i//TraditionalForm

About center

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

i//TraditionalForm

(i=With[{ρ=(M/(π (a^2)h))},ρ Integrate[r InertiaTensor[{r,θ,z},"CoordinateSystem"->"Cylindrical"],{r,0,a},{θ,0,2π},{z,-h/2,h/2},Assumptions->a>0&&h>0]])//Timing

i//TraditionalForm

SurfaceArea

Integrate[a,{v,0,2Pi},{u,0,h}]

Volume

Integrate Boole

Integrate[Boole[x^2+y^2<r^2&&0<z<h],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->r>0&&h>0]

(π (r^2))h

Integrate[Boole[x^2+y^2<r^2&&-h/2<z<h/2],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞},Assumptions->r>0&&h>0]//Timing

Integrate Region

Assuming[a>0&&h>0,Integrate[1,{x,y,z}∈Cylinder[{{0,0,0},{0,0,h}},a]]]

Assuming[a>0&&h>0,Integrate[1,{x,y,z}∈Cylinder[{{0,0,-h/2},{0,0,h/2}},a]]]

RegionMeasure

Assuming[assum,Simplify@RegionMeasure[reg]]

bug(277787)

$Version

Assuming[assum,RegionMeasure[reg]]

Assuming[a>0&&h>0,RegionMeasure[Cylinder[{{0,0,0},{0,0,h}},a]]]

Assuming[a>0&&h>0,Simplify@RegionMeasure[Cylinder[{{0,0,0},{0,0,h}},a]]]

MeanCylindricalRadius

(x,y,z)

(1/(π (a^2)h))Assuming[a>0&&h>0,FullSimplify@Integrate[(Sqrt[x^2+y^2])Boole[x^2+y^2<a^2&&-h/2<z<h/2],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞}]]//Timing

(z,y,x)

(1/(π (a^2)h))Assuming[a>0&&h>0,FullSimplify@Integrate[(Sqrt[x^2+y^2])Boole[x^2+y^2<a^2],{z,-h/2,h/2},{y,-∞,∞},{x,-∞,∞}]]//Timing

MeanSphericalRadius

(x,y,z)

(1/(π (a^2)h))Assuming[a>0&&h>0,Integrate[(Sqrt[x^2+y^2+z^2])Boole[x^2+y^2<a^2&&-h/2<z<h/2],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞}]]//Timing

FullSimplify[Last[%]]

(z,y,x)

(1/(π (a^2)h))Assuming[a>0&&h>0,Integrate[(Sqrt[x^2+y^2+z^2])Boole[x^2+y^2<a^2],{z,-h/2,h/2},{y,-∞,∞},{x,-∞,∞}]]//Timing

FullSimplify[Last[%]]

Mean[Sqrt[#.#]&/@With[{a=1,h=.5},Table[{a Sqrt[RandomReal[]],0, h/2RandomReal[]},{10^6}]]]//Timing

With[{a=1,h=.5},
{((-(h^4)+10 (a^2) h (Sqrt[4 (a^2)+(h^2)])+(h^3) (Sqrt[4 (a^2)+(h^2)])-24 (a^4) Log[((2 a)/(h+(Sqrt[4 (a^2)+(h^2)])))])/(48 (a^2) h)),
(1/(π (a^2)h))NIntegrate[(Sqrt[x^2+y^2+z^2])Boole[x^2+y^2<a^2],{z,-h/2,h/2},{y,-a,a},{x,-a,a}]
}]//Timing

MeanSquareCylindricalRadius

(x,y,z)

(1/(π (a^2)h))Assuming[a>0&&h>0,FullSimplify@Integrate[(x^2+y^2)Boole[x^2+y^2<a^2&&-h/2<z<h/2],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞}]]//Timing

(z,y,x)

(1/(π (a^2)h))Assuming[a>0&&h>0,FullSimplify@Integrate[(x^2+y^2)Boole[x^2+y^2<a^2],{z,-h/2,h/2},{y,-∞,∞},{x,-∞,∞}]]//Timing

MeanSquareSphericalRadius

(1/(π (a^2)h))Assuming[a>0&&h>0,Integrate[(x^2+y^2+z^2)Boole[x^2+y^2<a^2&&-h/2<z<h/2],{x,-∞,∞},{y,-∞,∞},{z,-∞,∞}]]//Timing

With[{a=1,h=.5},
{(1/12) (6 (a^2)+(h^2)),
(1/(π (a^2)h))NIntegrate[(x^2+y^2+z^2)Boole[x^2+y^2<a^2],{z,-h/2,h/2},{y,-a,a},{x,-a,a}]
}]//Timing

Mean[#.#&/@With[{a=1,h=.5},Table[{a Sqrt[RandomReal[]],0, h/2RandomReal[]},{10^5}]]]

Metric Properties

Metric Tensor

MetricTensor[{a Cos[u],a Sin[u],v},{u,v}]//FullSimplify

Christoffel Symbol of the Second Kind

FullSimplify[ChristoffelSymbols[{a Cos[u],a Sin[u],v},{u,v}],a>0]

Vector Properties (infinite)

eqn={a Cos[u],a Sin[u],v};

Vector Length

FullSimplify[FullSimplify[Norm[eqn],a>0]/.Abs[x_]^(n_/;Mod[n,2]==0):>x^n]

Normal Vector

-Assuming[a>0&&(u|v)∈Reals,FullSimplify[NormalVector[eqn,{u,v}]/.Abs[x_]^(n_/;Mod[n,2]==0):>x^n]]