Skip to Main Content Skip to Search
Product Documentation

plot::Cylindricalsurfaces in 3D parameterized in cylindrical coordinates

plot::Cylindrical creates parameterized surfaces in 3D, with parametrization in cylindrical coordinates.

→ Examples

Call:

plot::Cylindrical([r, Symbol::phi, z], u = `u_{min}` .. `u_{max}`, v = `v_{min}` .. `v_{max}`, <a = amin .. amax>, Options)

Parameters:

r, Symbol::phi, z

the coordinate functions: arithmetical expressions or piecewise objects depending on the surface parameters u, v and the animation parameter a. Alternatively, MuPAD procedures that accept 2 input parameters u, v or 3 input parameters u, v, a and return a real numerical value when the input parameters are numerical. 
r, Symbol::phi, z are equivalent to the attributes XFunction, YFunction, ZFunction.

u

the first surface parameter: an identifier or an indexed identifier
u is equivalent to the attributes UName, UMin, UMax.

`u_{min}` .. `u_{max}`

the plot range for the parameter u: `u_{min}`, `u_{max}` must be numerical real values or expressions of the animation parameter a
`u_{min}` .. `u_{max}` is equivalent to the attributes URange, UMin, UMax.

v

the second surface parameter: an identifier or an indexed identifier
v is equivalent to the attribute VName.

`v_{min}` .. `v_{max}`

the plot range for the parameter v: `v_{min}`, `v_{max}` must be numerical real values or expressions of the animation parameter a
`v_{min}` .. `v_{max}` is equivalent to the attributes VRange, VMin, VMax.

See Also:

linalg::ogCoordTab, plot, plot::copy, plot::Polar, plot::Spherical, plot::Tube

Details:

Example 1

Using a constant radius for plot::Cylindrical, with the other two functions straight from the surface parameters, results in a right cylinder. This explains the name “cylindrical coordinates”:

plot(plot::Cylindrical([1, phi, z], phi = 0..2*PI, z = -1..1))

MuPAD graphics

Other straightforward examples include cones and paraboloids of revolution:

plot(plot::Cylindrical([r, phi, 2*r], r = 0..1, phi = 0..2*PI))

MuPAD graphics

plot(plot::Cylindrical([r, phi, r^2], r = 0..1, phi = 0..2*PI))

MuPAD graphics

Example 2

Cylindrical surfaces are drawn from evaluations on an equidistant mesh of points. In some cases, the default mesh density is insufficient or otherwise inappropriate:

plot(plot::Cylindrical([cos(phi^2), phi, z],
                       phi=-2.8..2.8, z=0..1/2))

MuPAD graphics

One possible change to this plot command is to explicitly set the mesh with the attribute Mesh. Note that this setting influences the density of parameter lines:

plot(plot::Cylindrical([cos(phi^2), phi, z],
                       phi=-2.8..2.8, z=0..1/2,
                       Mesh = [100, 5]))

MuPAD graphics

To increase the mesh density without introducing additional parameter lines, you can use submesh settings:

plot(plot::Cylindrical([cos(phi^2), phi, z],
                       phi=-2.8..2.8, z=0..1/2,
                       VMesh = 5, USubmesh = 3))

MuPAD graphics

Finally, we can also ask plot::Cylindrical to refine the mesh only in areas of higher curvature. In the following example, we allow for 2^3 = 8 additional points between each two neighboring points of the initial mesh:

plot(plot::Cylindrical([cos(phi^2), phi, z],
                       phi=-2.8..2.8, z=0..1/2,
                       VMesh = 5, AdaptiveMesh = 3))

MuPAD graphics

Example 3

If the radius- or the z-function/expression contains singularities, plot::Cylindrical employs heuristic clipping to select a range to display:

plot(plot::Cylindrical([1/sqrt((phi - PI)^2 + z^2), phi, z],
                       phi = 0..2*PI, z = -1..1))

MuPAD graphics

While these heuristics work well in many cases, there are also examples where they do not select a useful box:

plot(plot::Cylindrical([1/((phi - PI)^2 + z^2), phi, z],
                       phi = 0.. 2*PI, z = -1..1))

MuPAD graphics

In these cases, the user should set the range to display explicitly:

plot(plot::Cylindrical([1/((phi - PI)^2+z^2), phi, z],
                       phi = 0..2*PI, z = -1..1),
     ViewingBox = [-2..0.3, -1.5..1.5, -1..1])

MuPAD graphics

Example 4

Since the transformation from cylindrical to orthogonal coordinates is reversible (up to reducing the angle to the range [0, 2*PI], it is possible to plot any surface with plot::Cylindrical (although this is probably more a curiosity than really useful):

trans := linalg::ogCoordTab[Cylindrical, InverseTransformation]:
cyl   := trans(x, y, sin(x^2+y^2))

[sqrt(x^2 + y^2), arccos(x/sqrt(x^2 + y^2)) + sign(y)*(sign(y) - 1)*(PI - arccos(x/sqrt(x^2 + y^2))), sin(x^2 + y^2)]

plot(plot::Cylindrical(cyl, x = -2..2, y = -2..2))

MuPAD graphics

  


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