Math 2325 (Chapter 9) -- Parametric Curve Representation

Note: Be sure to run the following command first,before anything else!

<< Graphics`Animation`

Static Plots

General Plots

The following shows how to draw general parametric plots, with comments briefly explaining each piece of the command.

ParametricPlot[
{Cos[t], 
        Sin[t]},                                         (*x - function,  y - function*) 
{t, 0, 
        2*Pi},                                                  (*parameter and its range*) 
PlotRange  -> {{-2, 2}, {-2, 
            2}},          (*limits of graphing window*) 
AspectRatio -> 1, 
      PlotPoints -> 1000] (*technical stuff*)

Here's the same command, without the comments, to make it easier for you to modify and draw your own parametric plots.

ParametricPlot[ {Cos[t], Sin[t]}, {t, 0, 2*Pi}, 
      PlotRange  -> {{-2, 2}, {-2, 2}},  
      AspectRatio -> 1, PlotPoints -> 1000]

Shortcut:Param2

Param2, below, will make it easy for us to investigate the curves described in Section 9.2.3, namely, the parametric curves x=sin(pt)+cos(qt), y=sin(rt)+cos(st) over the interval 0≤ t ≤2π.   Note that you must define it before running it!

Param2[p_, q_, r_, s_] := 
        ParametricPlot[{Sin[p*t] + Cos[q*t], Sin[r*t] + Cos[s*t]}, {t, 0, 
            2*Pi}, PlotRange -> {{-2, 2}, {-2, 2}}, 
          AspectRatio -> 1,  PlotPoints  -> 1000];

Param2[1, 2, 1, 1]

Animation

The next cell will generate the graphics; directions for animating these are below the output.  The number in the middle of the first quadrant is the value of "t".  You can modify the x and y functions, the interval for t (with "starttime" and "endtime"), and the number of "frames" in the movie (with "nplots") in the beginning of the cell.  There should ordinarily be no need to modify anything else (anything below "Do not change anything below this line.").

Clear[big, starttime, endtime, x, y, t];
x[t_]  =  Cos[t];
y[t_]  =  Sin[t];
starttime  =  0;
endtime  =  2*Pi;
nplots  =  
        24;


  
\(\(big = 
        1.1*Max[
		Table[
              N[Abs[x[starttime + i/100*\((endtime - starttime)\)]]], {i, 0, 
                100}], 
		Table[
              N[Abs[y[starttime + i/100*\((endtime - starttime)\)]]], {i, 0, 
                100}]
	];\)
\)
\(Do[Show[

        ParametricPlot[{x[t], y[t]}, {t, starttime, 
            starttime + \((i/nplots)\)*\((endtime - starttime)\)}, 
          AspectRatio -> 1, PlotRange -> {{\(-big\), big}, {\(-big\), big}}, 
          PlotStyle -> {RGBColor[1, 0, 0], Thickness[0.01]}, 
          DisplayFunction -> Identity], 
        Graphics[
          Text[\ starttime + \((i/nplots)\)*\((endtime - starttime)\), {big/
                2, big/2}]], 
        Graphics[
			{PointSize[0.04], 
            Point[{x[
                  starttime + \((i/nplots)\)*\((endtime - 
                          starttime)\)], 
						\ \ \ \ \ \ \ \ \ \ \ y[starttime + \((i/nplots)\)*\((endtime - starttime)\)]}]\ \ \ }], 
        DisplayFunction -> $DisplayFunction], 
	{i, 1, nplots}]\)

To animate these graphics, close the cells by double-clicking on the (third from the left) cell bracket containing these graphs and only these graphs (only one graph will be showing).  While these cells are selected, go to the "Cell" menu above and choose "Animate Selected Graphics".

Art Duval, artduval@math.utep.edu
February 13, 2005;
animation courtesy of 
Tamara Olson, Michigan Technological University, 2006