LiveGraphicsCylindricalPlot3D.pl - provide an interactive plot on a rectangular cylinder.
This macro provides the CylindricalPlot3D
method for creating an interactive plot of a function of two variables z = f(r, t)
(where r
is the radius and t
is the angle) via the LiveGraphics3D
JavaScript applet. The method takes a MathObject
Formula of two variables defined over an annular domain and some plot options as input and returns a string of plot data that can be displayed using the Live3Ddata
routine of the LiveGraphics3D.pl macro.
Usage: CylindricalPlot3D(%options)
The available options are as follows.
function => $f
$f
is a MathObject Formula. For example, in the setup section define
Context()->variables->are(r => 'Real', t => 'Real');
$a = random(1, 3);
$f = Formula("$a * r + t"); # Use double quotes!
before calling CylindricalPlot3D
.
rvar => 'r'
Radial independent variable name, default 'r'. This must correspond to the radial variable used in the function
.
tvar => 't'
Angular independent variable name, default 't'. This must correspond to the angular variable used in the function
.
rmin => -3
Lower bound for the domain of the radial variable.
rmax => 3
Upper bound for the domain of the radial variable.
tmin => -3
Lower bound for the domain of the angular variable.
tmax => 3
Upper bound for the domain of the angular variable.
rsamples => 20
The number of sample values for the radial variable in the interval from rmin
to rmax
to use.
tsamples => 20
The number of sample values for the angular variable in the interval from tmin
to tmax
to use.
axesframed => 1
If set to 1 then the framed axes are displayed. If set to 0, the the framed axes are not shown. This is 1 by default.
xaxislabel => 'x'
Label for the axis corresponding to the first independent variable.
yaxislabel => 'y'
Label for the axis corresponding to the second independent variable.
zaxislabel => 'z'
Label for the axis corresponding to the dependent variable.
outputtype => 1
This determines what is contained in the string that the method returns. The values of 1 through 4 are accepted, and have the following meaning.
Return a string of only polygons (or edge mesh).
Return a string of only plot options.
Return a string of polygons (or edge mesh) and plot options.
Return the complete plot to be passed directly to the Live3DData
method.