3D Parametric Plots

Dr. Therese Shelton
Southwestern University
Georgetown, TX

It is assumed the reader has seen "parametric.nb" first.

Basics #1:   Traditional graph.

Clearing out the variables used avoids problems.

Clear[x,y,z,tmin,tmax, xmin,xmax,ymin,ymax,zmin,zmax,plotAll]

(Ignore the warnings about possible misspellings.  If they bother you, re-enter the same line.)

Define the functions for the parametric plot.

x[t_]:=(t/10);
 y[t_]:=2Sin[t];
z[t_]:=Cos[t];

Define the graphing window.

Sometimes, plotting in a cube allows for better comparisons between coordinate values.

Remember to be aware of different scales on the axes.

tmin=0.0;  tmax=6 π;
xmin =-2.0; xmax=2.0;
ymin=-2.0;  ymax=2.0;
zmin=-2.0;  zmax=2.0;

plotAll=ParametricPlot3D[{x[t],y[t],z[t]},{t,tmin,tmax},PlotRange->{{xmin,xmax},{ymin,ymax},{zmin,zmax}},AspectRatio->Automatic,AxesLabel->{"   x[t]  ","  y[t]  ","  z[t]  "}]

Colors

Define different colors for the different graphs

The current settings: 
r[t] is black; 
x is red; 
y is blue;
z is emerald green.

Clear[colorr,colorx,colory,colorz, colr, colx, coly, colz]

colorr=RGBColor[0,0,0];
colorx=RGBColor[1.,0.,0.]; 
colory=RGBColor[0.,0.,1.];
colorz =RGBColor[0.,0.790002,0.340007];

colr="black";
colx="red";
coly="blue";
colz="green";

Animation of curve traced by vectors

Clear[numberIntervals, deltat];

numberIntervals=20.0;

deltat=(tmax-tmin)/numberIntervals

StringJoin["Legend:  position vector is ",colx, "; curve is ",colr]

Cumulative animation

Clear[part];
part[q_]:=ParametricPlot3D[ {
{x[t],y[t],z[t]},
{x[q],0 ,0  },{0,y[q],0},{0,0,z[q]},{x[q],y[q],z[q]} },
{t,tmin,q},
DisplayFunction->Identity];

Manipulate[Show[{part[q],Graphics3D[{
{colorx,AbsoluteThickness[.02],Line[{{0,0,0},{x[q],y[q],z[q]}}]}
                 }] },
PlotRange-> {{xmin,xmax},{ymin,ymax},{zmin,zmax}},Axes->Automatic,AspectRatio->Automatic,
AxesLabel->{" x "," y ", " z "},
DisplayFunction->$DisplayFunction],

{q,tmin + deltat, tmax, deltat}]

Basics #2:  Projections

Each projection can be done several ways.

Perhaps the simplest is to look at plots of the coordinate functions, taking the projection onto the vertical axis.

(do the same for y and for z)

Plot[x[t],{t,tmin,tmax},PlotStyle->{colorx},AxesLabel->{"    t","x[t]"}]

Make a 2D "shadow" plot for two coordinate axes.

(do the same for y and for z)

ParametricPlot[{x[t],0},{t,tmin,tmax},PlotStyle->{Thickness[0.015`],colorx},PlotRange->{{xmin,xmax},{zmin,zmax}},AxesLabel->{"   x[t] shadow","z[t] blank"},AspectRatio->Automatic]

Make a 3D"shadow" plot for two coordinate axes.

(do the same for y and for z)

ParametricPlot3D[{x[t],0,0},{t,tmin,tmax},PlotRange->{{xmin,xmax},{ymin,ymax},{zmin,zmax}},AxesLabel->{"   x[t] shadow","  y[t] blank","z[t] blank"},AspectRatio->Automatic]

It is a good exercise to be able to rotate the plot as desired.

In each of the next three rotated plots, you must still project the graph onto the intended axis.

These three viewpoints are good standards to use in this context.

This rotation can yield the y-values and the x-values.

ParametricPlot3D[{x[t],y[t],z[t]},{t,tmin,tmax},PlotRange->{{xmin,xmax},{ymin,ymax},{zmin,zmax}},AspectRatio->Automatic,ViewPoint->{0,0,3},AxesLabel->{"   x[t]  ","  y[t]  ","  z[t]  "}]

This rotation can yield the z-values and the y-values.

ParametricPlot3D[{x[t],y[t],z[t]},{t,tmin,tmax},PlotRange->{{xmin,xmax},{ymin,ymax},{zmin,zmax}},AspectRatio->Automatic,ViewPoint->{3,0,0},AxesLabel->{"   x[t]  ","  y[t]  ","  z[t]  "}]

This rotation shows the z-values and the x-values.

ParametricPlot3D[{x[t],y[t],z[t]},{t,tmin,tmax},PlotRange->{{xmin,xmax},{ymin,ymax},{zmin,zmax}},AspectRatio->Automatic,ViewPoint->{0,3,0},AxesLabel->{"   x[t]  ","  y[t]  ","  z[t]  "}]

Basics #3:  Direction on the static graph

TableForm[     Table[         {t,    N[  x[t]  ],   N[  y[t]  ], N[ z[t] ]}, 
{t,tmin,tmax,deltat}]     ]

Questions for students

By hand, label each point from the table on the parametric plot as "t=0", etc.  Draw arrows to indicate the direction of movement.  Write a short description of the direction, too.

Print out the table above and the plot below (click on the cell brackets, File/PrintSelection). Label the points on the plot.  It helps to enlarge the graph to distinguish the points, and sometimes a rotation is very helpful.

Clear[points2];points2=Table[Graphics3D[{PointSize[0.02`],Point[{x[t],y[t],z[t]}]}],{t,tmin,tmax,deltat}];
 Show[{plotAll,points},PlotRange->{{xmin,xmax},{ymin,ymax},{zmin,zmax}},Axes->Automatic,AspectRatio->Automatic,AxesLabel->{" x[t] "," y[t] "," z[t] "}]

Relation between r and the x and y coordinates with animation

Show all points

This is somewhat confusing at the default viewpoint, but changing viewpoints to see just two dimensions at a time is helpful.

After the "Do..." is executed, single click on the cell bracket holding all the plots, which is next to the innermost one.  From the pulldown menu,  Cell/AnimateSelectedGraphics.  Alter the speed on the control panel at the bottom left.

StringJoin["Legend:  x is ",colx, "; y is ",coly, "; z is ",colz, "; r is ",colr]

Manipulate[Show[
plotAll,
Graphics3D[{
{colorx,PointSize[.02],Point[{x[t],0,0}]},
{colory,PointSize[.02],Point[{0,y[t],0}]},
{colorz,PointSize[.02],Point[{0,0,z[t]}]},
{colorr,PointSize[.03],Point[{x[t],y[t],z[t]}]}
                 }],
PlotRange-> {{xmin,xmax},{ymin,ymax},{zmin,zmax}},
Axes->Automatic,AspectRatio->Automatic,
AxesLabel->{" x "," y ", " z "}],
{t,tmin,tmax,deltat}]

Focus on the x-coordinate and the parametric function.

StringJoin["Legend:  x is ",colx, "; y is ",coly, "; z is ",colz, "; r is ",colr]

Manipulate[Show[
plotAll,
Graphics3D[{
{colorx,PointSize[.02],Point[{x[t],0,0}]},
{colory,PointSize[.02],Point[{0,y[t],0}]},
{colorz,PointSize[.02],Point[{0,0,z[t]}]},
{colorr,PointSize[.03],Point[{x[t],y[t],z[t]}]}
                 }],
PlotRange-> {{xmin,xmax},{ymin,ymax},{zmin,zmax}},
Axes->Automatic,AspectRatio->Automatic,
AxesLabel->{" x "," y ", " z "},
ViewPoint->{0,0, 3}],
{t,tmin,tmax,deltat}]

Focus on the y and z-coordinates and the parametric function.

StringJoin["Legend:  x is ",colx, "; y is ",coly, "; z is ",colz, "; r is ",colr]

Manipulate[Show[
plotAll,
Graphics3D[{
{colorx,PointSize[.02],Point[{x[t],0,0}]},
{colory,PointSize[.02],Point[{0,y[t],0}]},
{colorz,PointSize[.02],Point[{0,0,z[t]}]},
{colorr,PointSize[.03],Point[{x[t],y[t],z[t]}]}
                 }],
PlotRange-> {{xmin,xmax},{ymin,ymax},{zmin,zmax}},
Axes->Automatic,AspectRatio->Automatic,
AxesLabel->{" x "," y ", " z "},
ViewPoint->{3,0, 0}],
{t,tmin,tmax,deltat}]

Show only the parametric function and one coordinate

x-coordinate

StringJoin["Legend:  x is ",colx,"; r is ",colr]

Manipulate[Show[
plotAll,
Graphics3D[{
{colorx,PointSize[.02],Point[{x[t],0,0}]},
{colorr,PointSize[.03],Point[{x[t],y[t],z[t]}]}
                 }],
PlotRange-> {{xmin,xmax},{ymin,ymax},{zmin,zmax}},Axes->Automatic,AspectRatio->Automatic,
AxesLabel->{" x "," y ", " z "},
ViewPoint->{0,0, 3}],
{t,tmin,tmax,deltat}]

y-coordinate

StringJoin["Legend:  y is ",coly, "; r is ",colr]

Manipulate[Show[
plotAll,
Graphics3D[{
{colory,PointSize[.02],Point[{0,y[t],0}]},
{colorr,PointSize[.03],Point[{x[t],y[t],z[t]}]}
                 }],
PlotRange-> {{xmin,xmax},{ymin,ymax},{zmin,zmax}},Axes->Automatic,AspectRatio->Automatic,
AxesLabel->{" x "," y ", " z "},
ViewPoint->{ 3, 0, 0}],
{t,tmin,tmax,deltat}]

z-coordinate

StringJoin["Legend:  z is ",colz, "; r is ",colr]

Manipulate[Show[
plotAll,
Graphics3D[{
{colorz,PointSize[.02],Point[{0,0,z[t]}]},
{colorr,PointSize[.03],Point[{x[t],y[t],z[t]}]}
                 }],
PlotRange-> {{xmin,xmax},{ymin,ymax},{zmin,zmax}},Axes->Automatic,AspectRatio->Automatic,
AxesLabel->{" x "," y ", " z "},
ViewPoint->{ 3, 0, 0}],
{t,tmin,tmax,deltat}]

Relate Cal I Concerns to parametric curves

Lab:
Link the rectangular behavior of the component functions to the movement in the x-direction on the parametric plot.  Then do the same for the other coordinates.

Preliminary graphs. Work from just these and do a lot of handwork or simple descriptions.

Plot[x[t],{t,tmin,tmax},PlotStyle->{colorx},AxesLabel->{"    t","x[t]"}]

Plot[y[t],{t,tmin,tmax},PlotStyle->{colory},AxesLabel->{"    t","y[t]"}]

Plot[z[t],{t,tmin,tmax},PlotStyle->{colorz},AxesLabel->{"    t","z[t]"}]