Surfaces of revolution around z-axis

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


plot::ZRotate(f, x = xmin .. xmax, <a = amin .. amax>, options)


plot::ZRotate(f, x = xmin..xmax) creates a surface of revolution by rotating the function graph z = f(x) with x ∈ [xmin, xmax] around the z-axis. The slice of the surface parallel to the x-y plane at a point z consists of circles with radii |xi| given by the solutions of f(x) = z.

The range of the rotation can be restricted with the attributes AngleBegin, AngleEnd, AngleRange. The surface of revolution spans over the given range of the rotation angle.

Surfaces of revolution are parametrized surfaces. The first surface parameter is x, the second is the rotation angle. Surfaces of revolution react to most of the graphical attributes that surfaces of type plot::Surface react to. For example, use Mesh and Submesh to control the numerical mesh or use ULinesVisible and VLinesVisible to enable or disable the parameter lines.


AttributePurposeDefault Value
AdaptiveMeshadaptive sampling0
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
AngleEndend of angle range2*PI
AngleBeginbegin of angle range0
AngleRangeangle range0 .. 2*PI
Colorthe main colorRGB::Red
Filledfilled or transparent areas and surfacesTRUE
FillColorcolor of areas and surfacesRGB::Red
FillColor2second color of areas and surfaces for color blendsRGB::CornflowerBlue
FillColorTypesurface filling typesDichromatic
FillColorFunctionfunctional area/surface coloring 
FillColorDirectionthe direction of color transitions on surfaces[0, 0, 1]
FillColorDirectionXx-component of the direction of color transitions on surfaces0
FillColorDirectionYy-component of the direction of color transitions on surfaces0
FillColorDirectionZz-component of the direction of color transitions on surfaces1
Framesthe number of frames in an animation50
Functionfunction expression or procedure 
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?TRUE
LineColorcolor of linesRGB::Black.[0.25]
LineWidthwidth of lines0.35
LineColor2color of linesRGB::DeepPink
LineStylesolid, dashed or dotted lines?Solid
LineColorTypeline coloring typesFlat
LineColorFunctionfunctional line coloring 
LineColorDirectionthe direction of color transitions on lines[0, 0, 1]
LineColorDirectionXx-component of the direction of color transitions on lines0
LineColorDirectionYy-component of the direction of color transitions on lines0
LineColorDirectionZz-component of the direction of color transitions on lines1
Meshnumber of sample points[25, 25]
MeshVisiblevisibility of irregular mesh lines in 3DFALSE
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
PointSizethe size of points1.5
PointStylethe presentation style of pointsFilledCircles
PointsVisiblevisibility of mesh pointsFALSE
Shadingsmooth color blend of surfacesSmooth
Submeshdensity of submesh (additional sample points)[0, 0]
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
Titleobject title 
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
TitlePositionZposition of object titles, z component 
ULinesVisiblevisibility of parameter lines (u lines)TRUE
UMeshnumber of sample points for parameter “u”25
USubmeshdensity of additional sample points for parameter “u”0
VLinesVisiblevisibility of parameter lines (v lines)TRUE
VMeshnumber of sample points for parameter “v”25
VSubmeshdensity of additional sample points for parameter “v”0
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE
XContourscontour lines at constant x values[]
XMaxfinal value of parameter “x”5
XMininitial value of parameter “x”0
XNamename of parameter “x” 
XRangerange of parameter “x”0 .. 5
YContourscontour lines at constant y values[]
ZContourscontour lines at constant z values[]


Example 1

For plot::ZRotate, the symmetry for a whole revolution is with respect to the x values:

plot(plot::Scene3d(plot::ZRotate(exp(x), x = -1..1)),
     plot::Scene3d(plot::ZRotate(exp(-x), x = -1..1)),
     Layout = Horizontal)

plot(plot::Scene3d(plot::ZRotate(exp(x), x = -1..1,
                                 AngleRange = -a..a, 
                                 a = 0..PI)),
     plot::Scene3d(plot::ZRotate(exp(-x), x = -1..1,
                                 AngleRange = -a..a, 
                                 a = 0..PI)),
     Layout = Horizontal)



The function: an arithmetical expression or a piecewise object in the independent variable x and the animation parameter a. Alternatively, a procedure that accepts 1 input parameter x or 2 input parameters x, a and returns a real numerical value when the input parameters are numerical.

f is equivalent to the attribute Function.


The independent variable: an identifier or an indexed identifier.

x is equivalent to the attribute XName.

xmin .. xmax

The plot range: xmin, xmax must be numerical real values or expressions of the animation parameter a.

xmin .. xmax is equivalent to the attributes XRange, XMin, XMax.


Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives