Example 06
Two Dimensional Parametric Plots
and Graphics Primitives

Copyright © 1993 by Bill Titus, Carleton College, 
Department of Physics and Astronomy, Northfield, MN  55057-4025
September 6, 1993

Topics and Skills

Problem

Solution

Step 1 - Complete the code below which uses  Set[]  to create the projectile equations for  x[t]  and  y[t]  as functions of  t,  vo,  angle,  and  g.

Clear[vo, angle, g, t, x, y]
x[vo_, angle_, t_, g_] = 
y[vo_, angle_, t_, g_] =

Comment 1

Step 2 - Check your functions by finding the values for  x  and  y  when  t = 1.0 s, using the initial conditions specified in the problem.  You may find the MMA constant  Degree  useful.

Comment 2

Step 3 - Now you want to plot  x[t]  versus  y[t].  To do so, find out information on the MMA function   ParametricPlot[].

Comment 3

Step 4 - Plot the desired trajectory, but for now don't include any options.

Step 5 - Add options to your plot so that the projectile is not shown entering the earth.  Also label your axes and title the plot.  Finally name the graphics object  plot1  so you can refer to it latter.

Comment 5

Step 6 - Start by finding out about MMA's  InputForm[]  and then apply this function to  plot1.  Describe what you see.

Comment 6

Step 7 - Look over the following code.  Try to guess the object that will be produced.  Then activate the cell and describe what you see.

Clear[myGraphics]
myGraphics =
   Graphics[
     {RGBColor[0, 0, 1],
      Circle[{0, 0}, 1],
      Circle[{0, 0}, 0.7, {Pi, 2Pi}],
      RGBColor[1, 0, 0],
      Disk[{-0.5, 0.5}, 0.1],
      Disk[{0.5, 0.5}, 0.1],
      RGBColor[0, 1, 0],
      Line[{{-0.2, -0.2}, {0.0, 0.2}, {0.2, -0.2}}],
      RGBColor[0, 0, 0],
      Text[FontForm["I'm pleased with myself",
             {"Times-Bold", 16}], {0, -1.2}]
     },
     {AspectRatio -> Automatic,
      Background  -> RGBColor[1,1,0]
     }];
      
Show[myGraphics];

Step 8 - Use  Graphics[]  and the graphics primitives  Line[]  and  Text[]  to construct a graphics object called  goalPost  so you can superimpose it on  plot1.

Step 9 - Combine the graphics object  goalPost  with  plot1  using  Show[].

Step 10 - During a given MMA session, MMA saves all the input and output in memory, even if you delete material from your notebook.  The commands  ??In  and  ??Out  list all the input and output stored in memory.  Try typing  ??In.  What do you find?

Step 11 - Why might you want to delete the input and output information stored in memory?  To do so, you can use the following sequence of commands:

Comment 11

Save Your Notebook