Math 166
Computer Lab #10
Parametric Equations

Goal:  To examine graphing of parametric equations and to investigate their use.

The ParametricPlot Command

To sketch curves described by parametric equations, you need the Mathematica command 

  ParametricPlot[ {x[t], y[t]}, {t, tmin, tmax} ].

Here, x[t] and y[t] are functions or expressions that define the values of the x and y coordinates, given the value of the parameter t.  These are followed by the actual name of the parameter, and its lower and upper limits.  Often, the value of t can be thought of as an angle, but this is not always so.  Here is a sample command:

ParametricPlot[ {Sin[t], Sin[4t]}, {t,0,2 Pi}]

Another thing to notice is that we don't really know how wide or high our graph will be.  We control the range of t, but this doesn't tell us the maximum x value, for instance.  And if t represents an angle, then to draw a complete graph we might expect the range of t must be 0 to 2 Pi, but sometimes we only need to have t vary from 0 to Pi, sometimes from 0 to 4 Pi, depending on the situation.

ParametricPlot uses many of the same options you are familiar with for the usual Plot command, including AspectRatio, AxesLabel, PlotLabel, PlotRange, and PlotStyle.

However, unlike Plot, only one curve can be drawn at a time using ParametricPlot.  To show two or more parametric curves on the same plot, name the output of each ParametricPlot command, and then use the Show command at the end.

The Plot is Not the Whole Story

If we are only interested in producing a particular plot, such as a circle, there are many different pairs of parametric equations that will do.

On the other hand, each pair of parametric equations has some extra information hidden in it, which does not show up in the final plot.  In particular, a pair of parametric equations describes the order in which the points will be drawn, and even the "speed" at which they are drawn.  Sometimes this information has a physical meaning.

Example 1. 

a) Below is the graph of 
  x = t,  
  y = Sqrt(1-t2). 
As t changes from 0 to 1, the points (x(t),y(t)) on the graph are drawn from left to right.  The points are drawn as though the pen had a constant horizontal velocity.  Thus, it takes just as long to draw the curve from 0.20 < x < 0.40 as to draw the much shorter segment where 0.80 < x < 1.0.  The parameter t can be thought of as the x value itself.

ParametricPlot[{t,Sqrt[1-t^2]},{t,0,1},
  AspectRatio->Automatic];

b) Now consider the parametric equations 
  x = cos(t) 
  y = sin(t) 
As t changes from 0 to Pi/2, the points (x(t),y(t)) on the graph are drawn from right to left.  The points are drawn as though the pen had a constant angular velocity.  Thus, it takes just as long to draw the curve that lies between 10 and 20 degrees, as to draw the curve between 40 and 50 degrees.  The parameter t can be thought of as the angle the point (x(t),y(t)) makes with the horizon.

ParametricPlot[{Cos[t],Sin[t]},{t,0,Pi/2},
  AspectRatio->Automatic];

We have seen two different ways to describe a quarter-circle using parametric equations.  The two methods end up with the same picture, but they do draw the points on the picture in a different order, and even at different "speeds".

This fact won't matter if we just want the plots.  But suppose the parameter t represents time, and the value of (x(t),y(t)) represents the position of an object.   Then the plot only tells us where the object has been but not when; the parametric equations tell us both where and when the object was.

Problem #1 will ask to look at the similarities and differences of graphs of several parametric equations.

An Interesting Parametric Curve: Lissajous Figures

Using parametric equations we can graph curves that would be complicated in Cartesian coordinates.

For instance, if you scatter a powder over a square sheet of glass, and then stroke the glass with a violin bow, the powder will rearrange itself to form a Lissajous figure.  A set of parametric equations describing such a curve are:
  x = cos(a*t)
  y = sin(b*t)
where a and b are usually whole numbers.  Let's graph a Lissajous figure for which a=3 and b=4:

ParametricPlot[{Cos[3t],Sin[4t]},{t,0,2Pi}]

Another Parametric Curve: The Cycloid

Another parametric curve with some interesting applications is the cycloid.  A cycloid is the curve traced by a point P on the rim of a wheel as the wheel rolls along a straight line.  The following sequence of plots shows how the cycloid is created.

You can animate this sequence.  Click in the right margin of the first plot to select it, then hold down the shift key and click on the last plot as well.  Use Animate Selected Graphics from the Graph menu.  You may want to reset the number of frames per second.  This is done by going to the Graph menu and selecting Animation; a window will pop up and you can reset the frames per second - perhaps 2 or 3 per second.

In 1696 Johann Bernoulli proposed the "brachistochrone" problem.  He supposed that two points A and B were given, with B lower than A.  Then he thought about connecting the two points with a (stiff) wire, along which a bead was free to slide.  He asked if the shape of the wire made a difference in how long it took the bead to slide down to point B (of course it does!).  Then he asked if there was a special shape for the wire which would cause the bead to slide from A to B in the least possible time.

If B is directly below A, then the fastest wire is also the shortest one, namely, a straight wire.  But if B is to the left or right of A, then a straight wire is not the fastest path.  Instead, the fastest path is an inverted (upside down) cycloid.

Even though a straight wire has the shortest length, the bead on the cycloid starts falling much more quickly, and so builds up an early velocity advantage that allows it to beat all other shapes.

p1=Plot[(-1.7519)*x,{x,0,1.414},
Axes->False,AspectRatio->Automatic,
PlotLabel-> Line,DisplayFunction->Identity]
d1=ListPlot[{{.5,-1.7519*.5}},PlotStyle->
{PointSize[.08],RGBColor[1,0,0]},
Axes->False,DisplayFunction->Identity]
s1=Show[p1,d1,DisplayFunction->$DisplayFunction]
p=ParametricPlot[{t-Sin[t],-1+Cos[t]},{t,0,Pi/2},
Axes->False,AspectRatio->Automatic,
PlotLabel->Cycloid,DisplayFunction->Identity]
d=ListPlot[{{Pi/4-Sin[Pi/4],-1+Cos[Pi/4]}},PlotStyle->
{PointSize[.08],RGBColor[1,0,0]},
Axes->False,DisplayFunction->Identity]
s=Show[p,d,DisplayFunction->$DisplayFunction]
Show[GraphicsArray[{s,s1}]]

Another interesting property of cycloids is that if A is the lowest point on the inverted cycloid, the time it takes a bead to slide down to A is the same no matter where on the cycloid the bead starts. In other words, if B1, B2, and B3 are beads in different positions on the cycloid, and they are all allowed to begin sliding at the same time, they will all reach A at the same time.

p1=ParametricPlot[{t-Sin[t],-1+Cos[t]},{t,0,1.5Pi},
Axes->False,DisplayFunction->Identity]
b=ListPlot[{{2Pi/3-Sin[2Pi/3],-1+Cos[2Pi/3]},{Pi/2-Sin[Pi/2],
-1+Cos[Pi/2]},{Pi/3-Sin[Pi/3],-1+.5}},PlotStyle->
{PointSize[.05],RGBColor[1,0,0]},Axes->False,
DisplayFunction->Identity]
Show[p1,b,DisplayFunction->$DisplayFunction]

The parametric equations for a cycloid are:
  x = a*(t - Sin[t]), 
  y = a*(1 - Cos[t]). 
where a is any value, though usually positive, and representing the radius of the wheel.  This means that the cycloid will "touch the ground" every 2*Pi*a units.  

The parameter t measures the amount of turning the wheel does, in radians.  Thus if t increases by 80*Pi, then the wheel must turn forty times, since a full revolution is 2*Pi.

Clear[t]

ParametricPlot[{2*(t-Sin[t]),2*(1-Cos[t])},{t,0,4Pi},
  AspectRatio->Automatic,
  Ticks->{{2Pi,4Pi,6Pi,8Pi},{2,4}}];

By the way, the parametric equations for the inverted cycloid discussed earlier are: 
  x = a*(t - Sin[t]), 
  y = a*(Cos[t]+1).
Here is an inverted cycloid, with a=1:

Clear[t]

ParametricPlot[{t-Sin[t],Cos[t]+1},{t,0,4Pi},
  AspectRatio->Automatic,
  Ticks->{{2Pi,4Pi},{2}}];

Finding the Slope of a Parametric Curve

We can find the slope dy/dx of a curve definted by parametric equations by starting with the chain rule 
  dy/dt = dy/dx dx/dt. 
Therefore 
  dy/dx = (dy/dt) / (dx/dt). 
In other words, to find the usual slope, we must differentiate the parametric functions x(t) and y(t), and take their ratio.

Let's try to find the slope of the cycloid 
  x = 2*(t - Sin[t]), 
  y = 2*(1 - Cos[t]). 
for the points x = Pi/2, Pi, and 6.

Clear[x,y,dydx]

x[t_]:=2(t-Sin[t])
y[t_]:=2(1-Cos[t])

dydx[t_]:=N[ y'[t]/x'[t] ]

dydx[Pi/2]
dydx[Pi]
dydx[6]

Exercise: Over the t interval [0, 2 Pi], where is the slope dydx undefined?

dydx[t]

dydx will be undefined exactly when
  cos(t) = 1.  
In the inverval [0, 2 Pi], that happens just when t=0 and t=2 Pi.

Exercise: Where is dydx equal to -1? 

To find where the slope is -1, we must use the FindRoot command, and to do that, it's best to have a reasonable estimate for an answer to the problem.  To get our estimate, we plot dydx[t] and -1 on the same graph and see where they intersect.  Since dydx is undefined when t=0 and t=2 Pi, we shrink the plotting interval a little to avoid error messages.

Plot[ {dydx[t],-1}, {t, 0.001, 2 Pi - 0.001},
  PlotRange->{-2,2},
  PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0]}]

From the graph, it looks like the crossing happens when t is about 4.5.  Now we can call FindRoot to get a much better estimate.

FindRoot[ dydx[t] == -1, {t,4.5} ]

We can check this answer by computing the slope function there:

dydx[4.71239]

Math 166
Computer Lab #1
Name:_ _ _ _ _ _ _ _ _ _
Instructor:_ _ _ _ _ _ _ _ _

1. a. Make separate plots of each of the following curves.  The parameter t should range between -5 and 5.  
			i.   x = t,  y = t3

ii.  x = t2, y = t6

iii. x = et, y = e3t.  Note that et is written E^t, and be sure to use parentheses when writing out e3t!

iv.  x = sin(t), y = sin3(t)

b. Discuss any relationships you see among the four graphs.

2.		The parametric equations: 
  x = a*t - b*sin(t), 
  y = a   - b*cos(t)
are variations on the standard cycloid. 

If the point P lies inside the rolling circle, then b < a, and it is called a curtate cycloid.  

If P lies outside the circle, then b > a and the curve is called a prolate cycloid.
  
  a) Sketch the prolate cycloid with a=1 and b=2, over the range
0 <= t <= 4 Pi.  Use the AspectRatio->Automatic option to make the picture correctly proportioned.

b) Sketch the curtate cycloid with a=2 and b=1, over the range
0 <= t <= 4 Pi.  Use the PlotRange option to make the axes cross at the origin.

c) Find the slope dydx[t] of the curtate cycloid, and evaluate it for t = 2.5 and t=3*Pi/2.

d) Over the interval [0, 2 Pi], where is the slope dydx[t] zero?  Where is it undefined?  Where does it equal 0.3?

3. Suppose Earth is moving on the path 
  x[t]= cos2(t), 
  y[t]= sin(t)*cos(t). 
and a meteor is moving along the path 
  x[t]= (t - 1.6)/3, 
  y[t]= 0.2

a) Use ParametricPlot to plot the motion of the earth.

b) Make a separate plot for the motion of the meteor.

c) Use the Show command to put your two plots together.  What are the x and y coordinates of the points where the paths of earth and the meteor cross?

d) Does the meteor actually collide with the Earth?  Remember, this means the two objects occupy the same space (x,y) at the same time t.  
   
4. If a projectile is launched from height s0 with an initial velocity v0 at an angle A (measured from the horizontal), then its position t seconds later may be described by the following parametric equations:

x[t]=(v0*cosA)*t, 
  y[t]=s0 + (v0*sinA)*t - 1/2g*t2

where g is the acceleration due to gravity (32 feet per second per second).  Air resistance is neglected in these equations. 

   a) Eliminate the parameter t to obtain the equation of the projectile in xy - coordinates. What geometric figure is it?

b) Suppose the projectile is a major league fastball which leaves the pitcher's hand traveling horizontally with initial speed 110 feet per second and initial height 7 feet. 
   
  i) Plot the graph of the path of the fastball.

ii) When does the ball cross the plate 60.5 feet away?

iii) If the strike zone is between a batter's armpits and knees, is the pitch a strike?

iv) If the batter, catcher and umpire all miss the ball, where will it land?

v) What additional factors would need to be included if the pitch is a curve ball and we want to predict its path?