**Parametric Space Curves in Maple**

**Copyright © 2001 by James F. Hurley, University of Connecticut Department of Mathematics, Unit 3009, Storrs CT 06269-3009. All rights reserved.**

*The interactive version of this worksheet is in the course folder, within the Workspace volume in MSB 203.*
(To access such files remotely, connect to the G3 Server in the MSB Math zone. From any Apple Macintosh on the UConn network, select Chooser and click on the AppleShare icon. under Chooser. That reveals all zones available for access. Scroll through the list until you see MSB Math and click on it. Then click on the g3server and log in as a guest. You can then interact with the worksheet if the computer you are working on has Maple installed.)

Maple readily produces 3-dimensional plots of parametric curves. The basic command for plotting parametric curves in real 3-dimensional space is

spacecurve( [x(t), y(t), , t = a..b] )
.

This is not available in Maple's basic start-up configuration. You must first load the package
plots
, which as we have already seen provides many handy 3-dimensional plotting tools.

For example, the following two-line routine plots the
*circular helix*
of radius 1 over the
*t*
-interval [Ð4¹, 4¹.]:

** r**
(
*t*
) = <
>.

The option
axes = boxed
puts a coordinate box around the curve. For a different style of display, change
boxed
to
frame
. Try it!

`> `
**with (plots):
spacecurve( [cos(t), sin(t), t], t = -4*Pi..4*Pi, axes = boxed );**

By default, Maple plots just 50 points. For a smoother curve, increase that. The following command does so, and adds axes labels.

`> `
**with (plots):
spacecurve( [cos(t), sin(t), t], t = -4*Pi..4*Pi, axes = boxed, numpoints = 150, labels = ["x", "y", "z"] );**

Warning, the name changecoords has been redefined

What more can Maple do to enhance the display?The following routine addresses the weak coloration of the curve by plotting it all in red, and also
adds labels (magenta in color) to the plot at their actual positionsÑrather than on a surrounding box.. The result looks similar to textbook graphs, and so you can use this routine to recreate and explore variations on those figures.

Maple's live-rotation feature lets you click on a plot, and use the mouse to rotate it any way you like to get a different view of the curve.

`> `
**with (plots):
curve := spacecurve( [cos(t), sin(t), t], t = -4*Pi..4*Pi, axes=boxed, numpoints = 150, color = red, labels = ["x", "y", "z"] ):
xaxis := spacecurve( [t, 0, 0, t = -1..1, color = magenta] ):
yaxis := spacecurve( [0, t, 0, t = -1..1, color = magenta] ):
zaxis := spacecurve( [0, 0, t, t = -12..12, color = magenta] ):
labx := textplot3d([1.2, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,1.2, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 12.5, `z`], color = magenta):
display(curve, xaxis, yaxis, zaxis, labx, laby, labz);**

**Combining surface and curve plots.**
** **
It can be helpful to plot both surfaces and space curves together. The following example comes from James Stewart,
*Calculus, 4th Edition*
, ITP Brooks/Cole, 1999, Section 14.1 (Exercise 32).

**Example. **
The elliptical paraboloid
and the parabolic cylinder
intersect in a curve. Parametrize the curve and plot it with the surfaces.

**Solution**
. A simple parametriztion for the curve results from letting
*x*
=
*t*
, for then
and
. This leads to the parametric representation

**r**
(
*t*
) = <
>.

How about the surfaces? Maple can certainly plot the first one as a simple equation
*z*
=
*f*
(
*x*
,
*y*
), but to plot the second one, in which no
*z*
appears, it is best to look ahead to parametric representation of surfaces. The idea is similar to parametric representation of curves, except that surfaces are
*two-dimenstional*
and so are described parametrically by two parametric variables, say
*t*
and
*u*
. With this point of view, we can parametrize the parabolic cylinder
as follows:

** r**
(
*t*
,
*u*
) = <
*t*
,
>.

Maple has a special command to plot parametric surfaces, and not surprisingly its syntax resembles that for the
spacecurve
command. The parametric surface plotting command is

plot3d( [x(t, u), y(t, u), z(t, u)] , u = a..b, v = c..d ) ;

The following routine plots and displays the curve with coordinate axes.

`> `
**with (plots):
curve := spacecurve( [t, t^2, 4*t^2 + t^4], t = -2..2, axes=boxed, numpoints = 150, labels = ["x", "y", "z"], color = red ):
xaxis := spacecurve( [t, 0, 0, t = -2..2, color = magenta] ):
yaxis := spacecurve( [0, t, 0, t = -4..4, color = magenta] ):
zaxis := spacecurve( [0, 0, t, t = -1..30, color = magenta] ):
labx := textplot3d([2.2, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,4.2, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 30.5, `z`], color = magenta):
display(curve, xaxis, yaxis, zaxis, labx, laby, labz);**

The next routine plots the two surfaces and then displays them together.

`> `
**surf1 := plot3d(4*x^2 + y^2, x = -1..1, y = -2..2, color = blue):
surf2 := plot3d([t, t^2, u ], t = -1..1, u = -3..3):
xaxis := spacecurve( [t, 0, 0, t = -2..2, color = magenta] ):
yaxis := spacecurve( [0, t, 0, t = -4..4, color = magenta] ):
zaxis := spacecurve( [0, 0, t, t = -1..10, color = magenta] ):
labx := textplot3d([2.2, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,4.2, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 10.5, `z`], color = magenta):
display(surf1, surf2, xaxis, yaxis, zaxis, labx, laby, labz);**

Finally, this routine superimposes the red space curve onto the plot of the two surfaces:

`> `
**surf1 := plot3d(4*x^2 + y^2, x = -1..1, y = -2..2, color = blue):
surf2 := plot3d([t, t^2, u ], t = -1..1, u = -3..3):
curve := spacecurve( [t, t^2, 4*t^2 + t^4], t = -1..1, axes=boxed, numpoints = 150, labels = ["x", "y", "z"], color = red ):
xaxis := spacecurve( [t, 0, 0, t = -2..4, color = magenta] ):
yaxis := spacecurve( [0, t, 0, t = -1..2, color = magenta] ):
zaxis := spacecurve( [0, 0, t, t = -1..8, color = magenta] ):
labx := textplot3d([4.2, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,2.2, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 8.5, `z`], color = magenta):
display(surf1, surf2, curve, xaxis, yaxis, zaxis, labx, laby, labz);**

`> `