Surfaces in 3D parameterized in cylindrical coordinates
MuPAD® notebooks are not recommended. 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::Cylindrical([r, ϕ, z]
, u = u_{min} .. u_{max}
, v = v_{min} .. v_{max}
, <a = a_{min} .. a_{max}
>, options
)
plot::Cylindrical
creates surfaces parametrized
in cylindrical coordinates.
The surface given by a mapping ("parametrization") is the set of all image points
in cylindrical coordinates, which translate to the usual "Cartesian" coordinates as
.
r is referred to as "radius," ϕ as "polar angle," and z as the "height" of a point.
The functions r, ϕ, z are
evaluated on a regular equidistant mesh of sample points in the uv plane.
This mesh is determined by the attributes UMesh
, VMesh
.
By default, the attribute AdaptiveMesh = 0
is set,
i.e., no adaptive refinement of the equidistant mesh is used.
If the standard mesh does not suffice to produce a sufficiently
detailed plot, one may either increase the value of UMesh
, VMesh
or USubmesh
, VSubmesh
,or
set AdaptiveMesh = n
with some (small) positive
integer n
. If necessary, up to 2^{n} 
1 additional points are placed in each direction
of the uv plane
between adjacent points of the initial equidistant mesh. Cf. Example 2.
"Coordinate lines" ("parameter lines") are curves on the surface.
The phrase "ULines
" refers
to the curves (r(u, v_{0}), ϕ(u, v_{0}), z(u, v_{0})) with
the parameter u running
from u_{min}
to u_{max}
,
while v_{0} is
some fixed value from the interval [v_{min},
v_{max}]
.
The phrase "VLines
" refers
to the curves (r(u_{0}, v), ϕ(u_{0}, v), z(u_{0}, v)) with
the parameter v running
from v_{min}
to v_{max}
,
while u_{0} is
some fixed value from the interval [u_{min},
u_{max}]
.
By default, the parameter curves are visible. They may be switched
off by specifying ULinesVisible = FALSE
and VLinesVisible
= FALSE
, respectively.
The coordinate lines controlled by ULinesVisible =
TRUE/FALSE
and VLinesVisible = TRUE/FALSE
indicate
the equidistant mesh in the uv plane
set via the UMesh
, VMesh
attributes.
If the mesh is refined by the USubmesh
, VSubmesh
attributes,
or by the adaptive mechanism controlled by AdaptiveMesh =
n
, no additional parameter lines are drawn.
As far as the numerical approximation of the surface is concerned, the settings
UMesh = n_{u}
, VMesh
= n_{v}
, USubmesh = m_{u}
, VSubmesh
= m_{v}
and
UMesh = (n_{u}  1) (m_{u} +
1) + 1
, VMesh = (n_{v}  1) (m_{v} +
1) + 1
,
USubmesh = 0
, VSubmesh = 0
are equivalent. However, in the first setting, n_{u}
parameter
lines are visible in the u direction,
while in the latter setting (n_{u} 
1) (m_{u} + 1) + 1
parameter
lines are visible. Cf. Example 2.
Use Filled
= FALSE
to
obtain a wireframe representation of the surface.
If the expressions/functions r and/or z contain
singularities, it is recommended (but not strictly necessary) to use
the attribute ViewingBox
to set a suitable viewing
box. No such precautions are necessary for ϕ,
although singularities in this function may result in poorly rendered
surfaces – in many cases setting the attributes Mesh
and/or AdaptiveMesh
to
higher values will help. Cf. Example 3.
Attribute  Purpose  Default Value 

AdaptiveMesh  adaptive sampling  0 
AffectViewingBox  influence of objects on the ViewingBox of
a scene  TRUE 
Color  the main color  RGB::Red 
Filled  filled or transparent areas and surfaces  TRUE 
FillColor  color of areas and surfaces  RGB::Red 
FillColor2  second color of areas and surfaces for color blends  RGB::CornflowerBlue 
FillColorType  surface filling types  Dichromatic 
FillColorFunction  functional area/surface coloring  
FillColorDirection  the direction of color transitions on surfaces  [0 , 0 , 1 ] 
FillColorDirectionX  xcomponent of the direction of color transitions on surfaces  0 
FillColorDirectionY  ycomponent of the direction of color transitions on surfaces  0 
FillColorDirectionZ  zcomponent of the direction of color transitions on surfaces  1 
Frames  the number of frames in an animation  50 
Legend  makes a legend entry  
LegendText  short explanatory text for legend  
LegendEntry  add this object to the legend?  TRUE 
LineColor  color of lines  RGB::Black.[0.25] 
LineWidth  width of lines  0.35 
LineColor2  color of lines  RGB::DeepPink 
LineStyle  solid, dashed or dotted lines?  Solid 
LineColorType  line coloring types  Flat 
LineColorFunction  functional line coloring  
LineColorDirection  the direction of color transitions on lines  [0 , 0 , 1 ] 
LineColorDirectionX  xcomponent of the direction of color transitions on lines  0 
LineColorDirectionY  ycomponent of the direction of color transitions on lines  0 
LineColorDirectionZ  zcomponent of the direction of color transitions on lines  1 
Mesh  number of sample points  [25 , 25 ] 
MeshVisible  visibility of irregular mesh lines in 3D  FALSE 
Name  the name of a plot object (for browser and legend)  
ParameterEnd  end value of the animation parameter  
ParameterName  name of the animation parameter  
ParameterBegin  initial value of the animation parameter  
ParameterRange  range of the animation parameter  
PointSize  the size of points  1.5 
PointStyle  the presentation style of points  FilledCircles 
PointsVisible  visibility of mesh points  FALSE 
Submesh  density of submesh (additional sample points)  [0 , 0 ] 
TimeEnd  end time of the animation  10.0 
TimeBegin  start time of the animation  0.0 
TimeRange  the real time span of an animation  0.0 .. 10.0 
Title  object title  
TitleFont  font of object titles  [" sansserif " , 11 ] 
TitlePosition  position of object titles  
TitleAlignment  horizontal alignment of titles w.r.t. their coordinates  Center 
TitlePositionX  position of object titles, x component  
TitlePositionY  position of object titles, y component  
TitlePositionZ  position of object titles, z component  
ULinesVisible  visibility of parameter lines (u lines)  TRUE 
UMax  final value of parameter "u"  
UMesh  number of sample points for parameter "u"  25 
UMin  initial value of parameter "u"  
UName  name of parameter "u"  
URange  range of parameter "u"  
USubmesh  density of additional sample points for parameter "u"  0 
VLinesVisible  visibility of parameter lines (v lines)  TRUE 
VMax  final value of parameter "v"  
VMesh  number of sample points for parameter "v"  25 
VMin  initial value of parameter "v"  
VName  name of parameter "v"  
VRange  range of parameter "v"  
VSubmesh  density of additional sample points for parameter "v"  0 
Visible  visibility  TRUE 
VisibleAfter  object visible after this time value  
VisibleBefore  object visible until this time value  
VisibleFromTo  object visible during this time range  
VisibleAfterEnd  object visible after its animation time ended?  TRUE 
VisibleBeforeBegin  object visible before its animation time starts?  TRUE 
XContours  contour lines at constant x values  [] 
XFunction  function for x values  
YContours  contour lines at constant y values  [] 
YFunction  function for y values  
ZContours  contour lines at constant z values  [] 
ZFunction  function for z values 
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))
Other straightforward examples include cones and paraboloids of revolution:
plot(plot::Cylindrical([r, phi, 2*r], r = 0..1, phi = 0..2*PI))
plot(plot::Cylindrical([r, phi, r^2], r = 0..1, phi = 0..2*PI))
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))
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]))
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))
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))
If the radius or the zfunction/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))
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))
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])
Since the transformation from cylindrical to orthogonal coordinates
is reversible (up to reducing the angle to the range [0,
2 π], 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))
plot(plot::Cylindrical(cyl, x = 2..2, y = 2..2))

The coordinate functions: arithmetical expressions or


The first surface parameter: an identifier or an indexed identifier. 

The plot range for the parameter u:


The second surface parameter: an identifier or an indexed identifier.


The plot range for the parameter v:


Animation parameter, specified as 