Skip to Main Content Skip to Search
Product Documentation

plot::XRotatesurfaces of revolution around x-axis

plot::ZRotatesurfaces of revolution around z-axis

plot::XRotate(f, x = `x_{min}`..xmax) creates a surface of revolution by rotating the function graph y = f(x) with x in [x_min, x_max] around the x-axis.

plot::ZRotate(f, x = `x_{min}`..xmax) creates a surface of revolution by rotating the function graph z = f(x) with x in [x_min, x_max] around the z-axis.

→ Examples

Calls:

plot::XRotate(f, x = `x_{min}` .. `x_{max}`, <a = amin .. amax>, Options)

plot::ZRotate(f, x = `x_{min}` .. `x_{max}`, <a = amin .. amax>, Options)

Parameters:

f

the function: an arithmetical expression or a piecewise object in the independent variable x and the animation parameter a. Alternatively, a MuPAD 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.

x

the independent variable: an identifier or an indexed identifier
x is equivalent to the attribute XName.

`x_{min}` .. `x_{max}`

the plot range: `x_{min}`, `x_{max}` must be numerical real values or expressions of the animation parameter a
`x_{min}` .. `x_{max}` is equivalent to the attributes XRange, XMin, XMax.

See Also:

plot, plot::copy, plot::Function2d, plot::Function3d, plot::Surface

Details:

Example 1

By default, plot::XRotate displays a complete revolution, just as if an object was created on a lathe:

plot(plot::XRotate(2 - sin(x), x = 0..2*PI))

MuPAD graphics

This rotation is insensitive to negative values: The surfaces of revolution of f(x) and abs(f(x)) are identical:

plot(plot::Scene3d(plot::XRotate(sin(x), x = 0..2*PI)),
     plot::Scene3d(plot::XRotate(abs(sin(x)), x = 0..2*PI)),
     Layout = Horizontal)

MuPAD graphics

This symmetry is broken when not performing a whole revolution:

plot(plot::Scene3d(plot::XRotate(sin(x), x = 0..2*PI,
                                 AngleRange = -PI/2..PI/2)),
     plot::Scene3d(plot::XRotate(abs(sin(x)), x = 0..2*PI,
                                 AngleRange = -PI/2..PI/2)),
     Layout = Horizontal)

MuPAD graphics

plot::XRotate can be animated, like almost every plot object:

plot(plot::XRotate(sin(x + a), x = 0 .. 2*a + PI,
                   AngleRange = 0 .. PI + a/2,
                   a = 0..2*PI))

MuPAD graphicsimage

Example 2

As for plot::ZRotate, most of the points from above hold here, too. Obviously, the symmetry for a whole revolution is now with respect to the x values, not the function values:

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

MuPAD graphics

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)

MuPAD graphicsimage

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS