Solid of Revolution

Manipulate[
Show[{
curverev1,curve2low,
Graphics3D[
{
Line[{{1,0,-.04},{1,0,.04}}],
Line[{{4,0,-.04},{4,0,.04}}],
{Text[Row[{Style["y",Italic]," = ",Style["f",Italic],"(",Style["x",Italic],")"}],{4.75,0,1.2}],
Text[Style[Row[{Style["y",Italic]," = ",Style["g",Italic],"(",Style["x",Italic],")"}],14],{4.75,0,.55}],
If[θ1<π/2||(Not[solidrev1]&&θ1>π),Text[Style["a",Italic],{.95,0,-.25}],{}],
If[θ1<π/2||(Not[solidrev1]&&θ1>π),Text[Style["b",Italic],{4,0,-.25}],{}],
Text[Style["x",Italic],{5.2,0,0}],
Text[Style["y",Italic],{0,0,1.5}]},
{RGBColor[0,0,0],Line[{{0,0,0},{5,0,0}}],Line[{{0,0,-4},{0,0,4}}]},
If[(regionrev1&&Not[solidrev1])||(regionrev1 && solidrev1 && θ1<2π),{EdgeForm[None],LightBlue,Polygon[Join[Table[{x,(.25Sin[2x+1]+1) Sin[-θ1],(.25Sin[2x+1]+1) Cos[-θ1]},{x,1,4,.015}],Table[{x,(.15Cos[2x+1]+.5) Sin[-θ1],(.15Cos[2x+1]+.5) Cos[-θ1]},{x,4,1,-.015}]]]},{}],
If[solidrev1,{EdgeForm[None],If[washtran,Opacity[.75],Opacity[1]],Polygon[Join[Table[{4,(.25Sin[9]+1) Sin[-θ],(.25Sin[9]+1) Cos[-θ]},{θ,0,θ1,π/100}],Table[{4,(.15Cos[9]+.5) Sin[-θ],(.15Cos[9]+.5) Cos[-θ]},{θ,θ1,0,-π/100}]]]},{}],
If[solidrev1,{EdgeForm[None],If[washtran,Opacity[.75],Opacity[1]],Polygon[Join[Table[{1,(.25Sin[3]+1) Sin[-θ],(.25Sin[3]+1) Cos[-θ]},{θ,0,θ1,π/100}],Table[{1,(.15Cos[3]+.5) Sin[-θ],(.15Cos[3]+.5) Cos[-θ]},{θ,θ1,0,-π/100}]]]},{}]
}],
If[solidrev1,RevolutionPlot3D[.25Sin[2t+1]+1,{t,1,4},{θ,0,θ1},RevolutionAxis->{1,0,0},PerformanceGoal->"Quality",Mesh->None,PlotStyle->If[washtran,Opacity[.5],Opacity[1]]],{}],
If[solidrev1&&washtran,RevolutionPlot3D[.15Cos[2t+1]+.5,{t,1,4},{θ,0,θ1},RevolutionAxis->{1,0,0},PerformanceGoal->"Quality",Mesh->None,PlotStyle->Opacity[1]],{}]
},PlotRange->{{0,5},{-2,2},{-1.3,1.3}},
AxesOrigin->{0,0,0},Boxed->False,Axes->{None,None,Automatic},ViewPoint->{1.5,-4,0},Background->White,ImageSize->{450,450},Ticks->{{1,4},None,None},BaseStyle->14]
,
Delimiter,
Grid[{{
Control[{{regionrev1,True,"region"},Checkbox}],
Spacer[15],
Control[{{solidrev1,True,"solid"},Checkbox}],
Spacer[15],
Control[{{washtran,False,"transparent"},Checkbox}],
}}],
{{θ1,π,"rotate"},.0001,2π,Enabled->Dynamic[(regionrev1||solidrev1)]},
Initialization:>(curve2low=ParametricPlot3D[{x,0,.15Cos[2x+1]+.5},{x,.5,4.5},PlotStyle->{Black,AbsoluteThickness[1.75]}];curverev1=ParametricPlot3D[{x,0,.25Sin[2x+1]+1},{x,.5,4.5},PlotStyle->{Black,AbsoluteThickness[1.75]}]),
SaveDefinitions->True,AutorunSequencing->{2,4}]

CAPTION

This Demonstration illustrates how a solid (with a hole) is obtained by rotating a region bounded between two curves about the x axis. To see the process unfold, first select "region" and rotate the shaded region about the x axis. Or, select "solid" and rotate the region. Once the solid is obtained, select "transparent" to see its inside.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Solid of Revolution" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/SolidOfRevolution/

Contributed by: Lyle Cochran

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »