Surface of Revolution

Using Mathematica to draw surface of revolution. Personally, I believe drawing these by hand is easier. But Mathematica can do it for you!

Initializations

<<"Histograms`"
$BaseStyle={FontFamily->"Times",FontSize->18};

Example

Define the function, and shade the area we want to rotate about the x-axis:

f[x_] = x^3;
Plot[f[x],{x,0,1},AxesLabel->{"x","y"},PlotRange->{All,All},Filling->Axis]

The intrinsic command SurfaceOfRevolution will create the surface for you. It assumes the function is defined in the x z-plane, not the x y-plane. This is somewhat annoying, because if we were doing this by hand, we would talk about a function in the x y-plane and then rotate about the x-axis or the y-axis. To make the Mathematica syntax a bit easier to follow, I will switch to talking about a curve in the x z-plane rotated about the x -axis or the z-axis.

f[z_] = z^3;
Plot[f[z],{z,0,1},AxesLabel->{"x","z"},PlotRange->{All,All},Filling->Axis,FillingStyle->Green]

Rotated about the x-axis

Here is the rotation about the x-axis:

RevolutionPlot3D[f[z],{z,0,1},BoxRatios->{1,1,1},RevolutionAxis->{1,0},AxesLabel->{"x","y","z"},PlotRange->{{0,1},{-1,1},{-1,1}},ImageSize->{400,Automatic},PlotStyle->{Orange,Specularity[White,10]}]

You can also do this using a parametric representation of the space curve that is being rotated:

curve=ParametricPlot3D[{t,0,f[t]},{t,0,1},BoxRatios->{1,1,1},AxesLabel->{"x","y","z"},PlotStyle->{Blue,Thickness[0.02]},PlotRange->{{0,1},{-1,1},{-1,1}},ImageSize->{400,Automatic}]

RevolutionPlot3D[{t,0,f[t]},{t,0,1},BoxRatios->{1,1,1},RevolutionAxis->{1,0},AxesLabel->{"x","y","z"},PlotRange->{{0,1},{-1,1},{-1,1}},ImageSize->{400,Automatic},PlotStyle->{Orange,Specularity[White,10]}]

Show[%,curve]

Here is an animation of the surface being drawn:

h=20.0;
Manipulate[
RevolutionPlot3D[{t,0,f[t]},{t,0,1},{a,0,af},BoxRatios->{1,1,1},RevolutionAxis->{1,0},AxesLabel->{"x","y","z"},PlotRange->{{0,1},{-1,1},{-1,1}},ImageSize->{400,Automatic},PlotStyle->{Orange,Specularity[White,10]}],
{af,((2 π)/h),2 π,((2 π)/h)}]

Rotated about the z-axis

Here is an animation when the rotation is about the y - axis. Notice that the region being rotated is different from above:

f[z_] = z^3;
Plot[{1,f[z]},{z,0,1},AxesLabel->{"x","z"},PlotRange->{All,All},Filling->{1},FillingStyle->Green]

Here is the rotation about the z-axis:

RevolutionPlot3D[{t,0,f[t]},{t,0,1},BoxRatios->{1,1,1},RevolutionAxis->{0,1},AxesLabel->{"x","y","z"},PlotRange->{{-1,1},{-1,1},{0,1}},ImageSize->{400,Automatic},PlotStyle->{Red,Specularity[White,10]}]

Show[%,curve]

Here is an animation:

h=20.0;
Manipulate[
RevolutionPlot3D[{t,0,f[t]},{t,0,1},{a,0,af},BoxRatios->{1,1,1},RevolutionAxis->{0,1},AxesLabel->{"x","y","z"},PlotRange->{{-1,1},{-1,1},{0,1}},ImageSize->{400,Automatic},PlotStyle->{Red,Specularity[White,10]}],{af,((2 π)/h),2 π,((2 π)/h)}]