plot::xrotate -- generate plots
of surface of revolution (x-axis)
Introductionplot::xrotate(f, x = a..b) returns the
surface of revolution defined by the function f(x) around
the x-axis in the interval [a,b]. The rotation
angle ranges from 0 to 2*PI.
plot::xrotate(f, x = a..b, Angle = r1..r2)
returns the surface of revolution defined by the function
f(x) around the x-axis in the interval
[a,b]. The rotation angle ranges from r1 to
r2.
Call(s)plot::xrotate(f, x = a..b <, option1,
option2>...)
plot::xrotate(f, x = a..b, Angle = r1..r2 <, option1,
option2>...)
Parametersf |
- | arithmetical expression in x |
x |
- | identifier |
a, b, r1, r2 |
- | arithmetical expressions |
option1, option2, ... |
- | plot option(s) of the form option =
value |
Returnsan object of the domain type plot::Surface3d.
Related
Functionsplot, plot::Surface3d, plot::yrotate
Detailsplot::xrotate is the surface (x,r)
-> (x, f*cos(r), f*sin(r)), where x ranges from
a to b and r from 0 to
2*PI or r1 to r2, respectively. It is
an object of the domain type plot::Surface3d in two variables,
namely the identifier x and an identifier built of the
name "angle".plot to display
the revolution created on the screen.option1, option2... must
be valid plot options for three-dimensional graphical objects. See
plot3d for details.
Note that scene options are not allowed! You may
give scene options as optional arguments for the function plot, or use plot::Scene to create an object
representing a graphical scene.
Example
1Let us revolve the sinus function around the x-axis in the interval x in [0, PI]:
>> r:= plot::xrotate(sin(x), x = 1..3)
plot::Surface3d([x, sin(x) cos(angle1), sin(x) sin(angle1)],
x = 1..3, angle1 = 0..2 PI)
The result is a graphical object of the domain type
plot::Surface3d. To
display the surface on the screen, call plot:
>> plot(r)
Here you can give scene options, for example, to change the style of the axis:
>> plot(r, Axes = Box)
Example
2We can restrict the rotation angle like in the following call:
>> r2:= plot::xrotate(sin(x), x = 1..3, Angle = 0..PI): plot(r2)
Plot objects for the surface can be given together with
the call of plot::xrotate, like in:
>> r2:= plot::xrotate(sin(x), x = 1..3, Color = RGB::Blue): plot(r2)
Or use the slot operator :: to get or set
afterwards plot options of such graphical objects. For example, the
rotation angle of the revolution r2 is the
y-variable of the surface kept in the attribute
range2:
>> angle:= r2::range2
angle3 = 0..2 PI
Hence, to restrict the rotation angle to the interval [0,PI/2], we enter:
>> r2::range2:= lhs(angle) = 0 .. PI/2: plot(r2)
plotlib::xrotateplot::xrotate is now part of the new plot library
plot, and thus its
calling syntax and the return value were changed.