Different varieties of three-dimensional plots in Maple |
In addition to the basic plot3d
command, Maple has
several other useful commands for plotting surfaces. For
example, here are three different ways that Maple knows to
draw a sphere of radius 2 centered at the origin. (Remember first
to load the plots package via the with(plots):
command.)
Viewing the sphere as being implicitly defined by the equation x2+y2+z2=4, you could plot the surface with the following Maple command.
implicitplot3d(x^2+y^2+z^2=4, x=-2..2, y=-2..2, z=-2..2, scaling=constrained);
Alternatively, you could view the sphere as a parametric surface. For a two-dimensional surface, you need two parameters, say s and t. Try the following Maple command; can you identify what s and t represent in spherical coordinates?
plot3d( [2*sin(s)*cos(t), 2*sin(s)*sin(t), 2*cos(s)], s=0..Pi, t=0..2*Pi, scaling=constrained);
Maple knows about polar coordinates in two dimensions, and it knows about spherical coordinates in three dimensions. Here is a third way to plot the sphere.
sphereplot(2, theta=0..2*Pi, phi=0..Pi, scaling=constrained);
A new feature appears in three dimensions that we did not see
in two dimensions. Since there is more room in three
dimensions, we have the possibility of plotting either a
two-dimensional surface or a one-dimensional curve. We just saw
above how to plot a surface. To plot a one-dimensional
parametrized curve, use the spacecurve
command. The
following command plots a helix.
spacecurve( [cos(t), sin(t), t], t=0..4*Pi, title="helix");
A common way to describe a three-dimensional object is to
specify its cross section at each point along a curve. For
example, a cylinder is simply the Cartesian product of a line
with a circle. Maple has a tubeplot
command that
implements this idea. The following command draws a tube of
constant radius around the helix.
tubeplot( [cos(t), sin(t), t], t=0..4*Pi, radius=0.5, tubepoints=30, title="helix tube");
What happens if you modify this example by setting
radius=t/6
and scaling=constrained
?
Different varieties of three-dimensional plots in Maple |