\magnification=\magstep1
\centerline{Mathematics 241 -- Multivariable Calculus}
\centerline{Lab Day 1 -- More on parametric curves and visualizing other coordinate systems}
\centerline{September 15, 2010}
\bigskip
\noindent
{\it Goals}
\bigskip
\noindent
In this first lab day of the semester, we want to 
\medskip
\item{$\bullet$} Get familiar with the mechanics
of the Maple computer algebra system and using the Swords 219 Linux workstation lab, and
\item{$\bullet$} Learn how to use Maple for
plotting lines and planes.
\bigskip
\noindent
{\it A First Worked Maple Session -- Commands for 3D plotting}
\bigskip

The {\tt spacecurve} command in the {\tt plots}
package can be used to draw  parametric curves in 3-dimensional space. 
To use it, you will need to enter the command
\medskip
\centerline{\tt with(plots);}
\medskip
\noindent
to begin (just once in each Maple session).  
The {\it general format} for the command to plot a single curve is
\medskip
\centerline{\tt spacecurve([x(t),y(t),z(t),t=a..b]);}
\medskip
\noindent
where $x = x(t)$, $y = y(t)$, $z = z(t)$ are the parametric equations of 
the curve and the range of parameter values to be plotted is 
$a \le t \le b$.  
For instance, try entering
\medskip
\centerline{\tt spacecurve([5-2*t,t,1+t,t=-2..2]);}
\medskip
\noindent
to plot a part of the straight line through the point $p = (5,0,1)$ in 
the direction of $v = (-2,1,1)$.  (Do you see how $p$ and $v$
are showing up in the $x(t),y(t),z(t)$ equations?)

The first plot you see here might be rather uninformative. Fortunately, Maple
also lets you add axes and look at a 3D plot from different viewpoints. 
Here's how:
\bigskip
\item{1)}  Press the left mouse button over the graph.  This 
should bring up a ``bounding box'' for the graph with corners you 
can {\it drag and drop\/} with the mouse to resize the graph. 
\item{2)}  If you place the mouse over the graph, depress the 
left button, and drag the cursor, you should see the graph rotating
following the cursor position.  Release the left mouse button 
when you get to the position you want.
\item{3)}  If you click  
the right mouse button, you will bring up a menu containing the options
{\tt Style, Axes, Color} and several others.  Select
{\tt Axes, Normal} with the left mouse button. 
\item{4)}  There are also options in this menu for changing the color
of the curve plotted, setting the scales on the coordinate axes (``axes
constrained'' means equal scales on the three axes; the default is for
Maple to choose the scales to ``fill up'' the graphics window as much
as possible (for instance, Maple will not choose to produce a long, skinny plot
even if $-10 \le z \le 10$ for $-1 \le x,y \le 1$, etc.) 
\bigskip
\noindent
Practice a few times repositioning the viewpoint (rotating 
the viewing box) and redrawing the graph, perhaps changing the color, and
so forth.
\bigskip
To draw several parametric curves in the same graph, you can include
several curve specifications in the form {\tt [x(t),y(t),z(t),t=a..b]} 
between curly braces {\tt $\{$,$\}$}, separated by commas,
all inside the 
parentheses for the {\tt spacecurve\/} command.

\bigskip
\noindent
{\it Lab Exercise 1}
\bigskip
The {\it line segment} from $(a,b,c)$ to $(d,e,f)$ can be parametrized as follows
$$\alpha(t) = (a,b,c) + t(d-a,e-b,f-c) = (a + t(d-a), b + t(e-b), c + t(f - c))$$
for $0 \le t \le 1$.
The points $P = (0,0,0)$, $Q = (2,0,0)$, $R = (0,\sqrt{3},1)$, 
$S = (0,-1,\sqrt{3})$
are four corners of a cube in ${\bf R}^3$
with edges $PQ$, $PR$, and $PS$, because
the vectors $\vec{u} = Q-P, \vec{v} = R-P, \vec{w} = S-P$
all have magnitude 2, and
$\vec{u}\cdot\vec{v} = \vec{u}\cdot\vec{w} = \vec{v}\cdot\vec{w} = 0$.
Your assignment, {\it should you decide to accept it (just kidding!)}, is to 
create a picture of this cube by drawing the 12 edges together on the 
same set of axes in ${\bf R}^3$.  Begin by drawing the line segments
from $P$ to $Q$, $P$ to $R$, and $P$ to $S$, using
\bigskip
\centerline{\tt spacecurve($\{$[2*t,0,0,t=0..1],[0,sqrt(3)*t,t,t=0..1],[0,-t,sqrt(3)*t,t=0..1]$\}$);}
\bigskip
\noindent
(Be sure you understand where these come from!)
Then add in edges until you have the whole cube.  Explain how you found 
the other 4 corners of the cube.  This can be done in a text region.
({\it Suggestion:}  It is probably simplest to do the necessary calculations to
find the other points and the parametrizations of the edges of the cube
with pencil and paper by hand.  Use Maple to generate the plot and
check your work.)
\bigskip
\noindent
{\it Lab Exercise 2}
\bigskip
Begin by plotting the curve called the {\it twisted cubic} in ${\bf R}^3$ using
the command
\bigskip
\centerline{\tt spacecurve([t,t\^{}2,t\^{}3,t=-2..2]);}
\bigskip
\noindent
Then 
generate and display in your worksheet three separate plots showing what you see
if you view the twisted cubic curve looking 
\medskip
\item{a)} Straight along the positive $x$-axis toward the origin,
\item{b)} Straight along the positive $y$-axis toward the origin,
\item{c)} Straight down the positive $z$-axis toward the origin.
\item{d)} Also, explain in a text region how your three plots relate to 
the three coordinate functions of the curve $(t,t^2,t^3)$.  
\bigskip
\noindent
Note:  You can also plot a parametric curve in the plane using 
Maple.  The format for plotting a curve with parametric equations
$x = x(t), y = y(t)$ is 
\medskip
\centerline{\tt plot([x(t),y(t),t=a..b]);}
\medskip
\noindent
(Note the placement of the square brackets which follows
the same pattern as in the {\tt spacecurve} command.) 
This generates a 2D plot similar to the plot generated by 
{\tt spacecurve}, but without the rotation feature, etc.
You may want to illustrate your assertions in part d of this
question with several 2D plots.
\bigskip
\noindent
{\it Writeups}
\bigskip
Lab writeups due no later than 8:00am on Tuesday, September 21.  Please 
{\it email your completed Maple worksheet file to} 
\bigskip
\centerline{\tt jlittle@holycross.edu}
\bigskip
\noindent
as an attachment.  You may work together
with your discussion group on this assignment, but 
everyone should generate his or her own worksheet and 
submit it individually for this assignment.
\bye
