VC.01 Vectors Point the Way 
GIVE IT A TRY!

\(Off[General::spell]; 
\(Off[General::spell1]; \)\)\(Off[ParametricPlot3D::ppcom]; 
Off[ParametricPlot::ppcom]; 

    Off[Plot::plnr]; 
SetOptions[Limit, Analytic -> True]; \)

CMView = {2.7, 1.6, 1.2};

Vector Drawer

BeginPackage["Vector3D`", "Graphics`Colors`"];

\(Axes3D::"usage" = 
      "Axes3D[a, b] creates a Graphics3D object of cartesian axes with x, y, and z running from -a/3 to a, and with axes labels b units beyond the tips of the axes.  Axes3D[a] is Axes3D[a, a/8]."; 

    \(Perpend::"usage" = 
      "Perpend[a] returns a unit vector which is perpendicular to the vector a."; \)\)Arrow::"usage" = 
      "Arrow[a] produces a 2 or 3 dimensional vector from the origin to a. \
Arrow[a, Tail -> tail] gives a vector from tail to a."; Vector::"usage" = 
      "Vector[a, b] gives a 2D or 3D vector from a to b."; ArrowHead::"usage" = 
      "ArrowHead[a, vec] produces an arrowhead with its tip placed at the \
point a, pointing in the direction of the vector vec."; Tail::"usage" = 
      "Tail -> point puts the tail of the vector at point."; Norm::"usage" = 
      "Norm[vec] returns the Euclidean length of vec."; Normalize::"usage" = 
      "Normalize[vec] returns a unit vector in the direction of vec, \
provided vec is nonzero."; Aperture::"usage" = 
      "Aperture is the ratio of the radius of the base to the length of the \
head of a vector."; TipSize::"usage" = 
      "TipSize specifies an absolute size for the inner tip length of the \
head of a vector."; TipRatio::"usage" = 
      "TipRatio is the ratio of the inner length of the arrowhead to the \
length of the shaft of a vector."; HeadRatio::"usage" = 
      "HeadRatio is the ratio of the outer length of the arrowhead to the \
length of the shaft of a vector."; HeadSize::"usage" = 
      "HeadSize specifies an absolute size for the head of a vector."; 
    ScaleFactor::"usage" = 
      "ScaleFactor specifies the amount to scale a vector in length and may \
be either a number or a pure function."; ZeroVectorPointSize::"usage" = 
      "ZeroVectorPointSize is the size of the point used to represent a \
zero vector."; Options[Vector] = 
      Options[Arrow] = 
        Options[ArrowHead] = {HeadRatio -> 0.18, 
            TipRatio -> 0.14, Aperture -> 0.3, 
            ScaleFactor -> 1, HeadType -> Polygon, 
            ShaftQ -> True, EdgesQ -> True, 
            VectorColor -> RGBColor[0, 0, 1], ShaftWidth -> 0.005, 
            ZeroVectorPointSize -> 0.01}; Begin["`Private`"]; SetOptions[ParametricPlot, AspectRatio -> Automatic]; SetOptions[Plot, AspectRatio -> Automatic]; SetOptions[Graphics, AspectRatio -> Automatic]; Axes3D[u_, v_] := 
      Graphics3D[{{Blue, Line[{{-(u/3), 0, 0}, {u, 0, 0}}]}, 
          Text["x", {u + v, 0, 0}], {Blue, 
            Line[{{0, -(u/3), 0}, {0, u, 0}}]}, 
          Text["y", {0, u + v, 0}], {Blue, 
            Line[{{0, 0, -(u/3)}, {0, 0, u}}]}, 
          Text["z", {0, 0, u + v}]}]; Axes3D[u_] := Axes3D[u, (u/8)]; Norm[a_?VectorQ] := N[(Sqrt[a . a])]; Normalize[a_?VectorQ] := If[a . a == 0, a, (a/Norm)[a]]; Perpend[a_?VectorQ] := 
      Normalize[{a[[2]], 
            -a[[1]]}] /; 
        Length[a] == 2Perpend[a_?VectorQ] := 
      Normalize[
          If[a[[1]] == 0, {1, 0, 0}, {0, 
              a[[3]], 
              -a[[2]]}]] /; 
        Length[a] == 3Base3D = 
      Table[{Cos[((2 k π)/8.) ], Sin[((2 k π)/8.) ]}, {k, 0, 
          8}]; Vector[from_?VectorQ, to_?VectorQ, opts___] := 
      Module[{sq, sw, ht, hs, hr, tr, ap, sf, vc, zvps, diff = to - from, 
            tip}, {sq, sw, ht, hs, hr, ts, tr, ap, sf, vc, zvps} = 
            {ShaftQ, ShaftWidth, HeadType, HeadSize, HeadRatio, TipSize, 
                  TipRatio, Aperture, ScaleFactor, VectorColor, 
                  ZeroVectorPointSize} /. {opts} /. Options[Vector]; 
          If[from == to, 
            Return[Graphics[{PointSize[zvps], vc, Point[from]}]]]; 
          diff = If[NumberQ[N[sf]], sf diff, sf[diff]]; tip = from + diff; 
          If[NumberQ[hs], hr = (hs/Norm)[diff]; tr = 0.75 hr]; 
          If[NumberQ[ts], tr = (ts/Norm)[diff]]; 
          Graphics[{
              If[sq, {vc, Thickness[sw], Line[{from, tip - tr diff}]}, {}], 
              With[{trans = ap hr Norm[diff] Perpend[diff]}, {vc, 
                  Thickness[sw], 
                  ht[{tip, tip - hr diff + trans, tip - tr diff, 
                      tip - hr diff - trans, tip}]}]}]] /; 
        Length[from] == Length[to] == 2Vector[from_?VectorQ, to_?VectorQ, opts___] := 
      Module[{sq, eq, sw, hs, hr, tr, ap, sf, vc, zvps, diff = to - from, 
            tip}, {sq, eq, sw, hs, hr, ap, sf, vc, zvps} = 
            {ShaftQ, EdgesQ, ShaftWidth, HeadSize, HeadRatio, Aperture, 
                  ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts}
                   /. Options[Vector]; 
          If[from == to, 
            Return[Graphics3D[{PointSize[zvps], vc, Point[from]}]]]; 
          diff = If[NumberQ[N[sf]], sf diff, sf[diff]]; tip = from + diff; 
          If[NumberQ[hs], hr = (hs/Norm)[diff]]; tr = (hr/2); 
          Graphics3D[{
              If[sq, {vc, Thickness[sw], Line[{from, tip - tr diff}]}, {}], 
              If[eq, {}, EdgeForm[]], {SurfaceColor[vc], 
                With[{temp = Perpend[diff]}, 
                  (Polygon[Append[#1, tip]]&)/@
                    Partition[
                      (tip - hr diff + #1&)/@
                        ((ap hr Norm[diff] Base3D) . {temp, 
                              Normalize[temp\[Cross]diff]}), 2, 1]]}}]] /; 
        Length[from] == Length[to] == 3Arrow[a_, Tail -> b_, opts___] := Vector[b, a + b, opts]Arrow[a_, opts___] := Vector[Table[0, {Length[a]}], a, opts]\(ArrowHead[a_, b_, opts___] := 
      Vector[a - b, a, ShaftQ -> False, opts]; 

End[]; 

    \(EndPackage[]; \)\)

Graphics`Colors`GosiaGreen = RGBColor[0,  0.392187,  0];

G.1)  Vector and line fundamentals*

G.1.a.i)

Here is the vector X = {3, 1} shown with its tail at {0, 0}:

X = {3, 1}; Show[Arrow[X, Tail -> {0, 0}, VectorColor -> Red], 
      Axes -> True];

What point is the tip of X sitting on?

G.1.a.ii)

When you move the vector X = {3, 1} so that its tail is at {2, 2}, where will you find its tip?

G.1.a.iii)

Here are the points {3, 2} and {-1, 0}:

point1 = {3, 2}; \(point2 = {\(-1\), 0}; 


    Show[Graphics[{Red, PointSize[0.02], Point[point1]}], 
      Graphics[{Red, PointSize[0.02], Point[point2]}], PlotRange -> All, 
      Axes -> True, AxesLabel -> {"x", "y"}]; \)

Add to the plot the vector whose tail is at {3, 2} and whose tip is at {-1, 0}. 
Come up with parametric equations for the line that goes through both of these points.

G.1.b.i)

Here are vectors X and Y with their tails at {0, 0}:

X = {4, 1}; Y = {-6, 5}; labels = Graphics[{{Text["X", (X/2)]}, {Text["Y", (Y/2)]}}]; Show[Arrow[X, Tail -> {0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> {0, 0}, VectorColor -> Red], labels, 
      Axes -> True];

When you put the tail of X -  Y on the tip of Y, where does the tip of X -  Y turn out to be?

G.1.b.ii)

Here are vectors X and Y with the tail of X at {0, 0} and the tail of Y at the tip of X:

X = {2, -1}; Y = {8, 5}; labels = Graphics[{{Text["X", (X/2)]}, {Text["Y", X + (Y/2)]}}]; Show[Arrow[X, Tail -> {0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> X, VectorColor -> Red], labels, 
      Axes -> True];

When you put the tail of X +  Y  at {0, 0}, where does the tip of X +  Y turn out to be?
In the plot above, why is it that the label Y, which is planted at the point given by X+(Y/2), lands midway between the tail of Y and the tip of Y?

G.1.b.iii)

Here are vectors X and Y with the tail of X at {0, 0, 0} and the tail of Y at the tip of X:

X = {1, 4, -5}; \(Y = {2, \(-6\), 4}; 


    labels = Graphics3D[{{Text["X", X\/2]}, {Text["Y", X + Y\/2]}}]; 

    threedims = Axes3D[2, 0.2]; 

    \(Show[Arrow[X, Tail -> {0, 0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> X, VectorColor -> Red], threedims, labels, 
      ViewPoint -> CMView, Boxed -> False]; \)\)

When you put the tail of X +  Y at {0, 0, 0}, where does the tip of X +  Y turn out to be?
In the plot above, why is it that the label Y, which is planted at the point given by X+(Y/2), lands midway between the tail of Y and the tip of Y?

Tip:

We have used the shorthand command for building the 3-dimensional axes:

?Axes3D

G.1.b.iv)

Here are the same vectors as shown in the last part together with some points of the form
        {x, y} = X +  t Y for various choices of t:

X = {1, 4, -5}; Y = {2, -6, 4}; \(Clear[t]; 

    points = Table[
        Graphics3D[{PointSize[0.02], Point[X + t\ Y]}], {t, \(-2\), 3, 
          1\/2}]; 

    \(Show[Arrow[X, Tail -> {0, 0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> X, VectorColor -> Red], points, threedims, 
      labels, ViewPoint -> CMView, Boxed -> False]; \)\)

More points:

morepoints = 
      Table[Graphics3D[{PointSize[0.02], Point[X + t Y]}], {t, -2, 3, 
          (5/15)}]; Show[Arrow[X, VectorColor -> Red], 
      Arrow[Y, Tail -> X, VectorColor -> Red], morepoints, 
      threedims, labels, ViewPoint -> CMView, Boxed -> False];

What kind of curve do these points come from? 
Give a parametric formula for this curve.

G.1.c)

Here are two vectors in three dimensions:

X = {2, 1, 2}; Y = {1, -4, 1}; \(threedims = Axes3D[1.5, 0.2]; 


    Show[Arrow[X, Tail -> {0, 0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> {0, 0, 0}, VectorColor -> Red], threedims, 
      ViewPoint -> CMView, Boxed -> False]; \)

And here's a calculation of X . Y:

X . Y

What piece of definite information about the relationship between X and Y did you get from the calculation of X . Y?

G.1.d.i)

Here are plots of two lines in three dimensions:

point1 = {1, 1, 1}; point2 = {2, 2, 1.5}; X1 = {2, 2, 1}; \(X2 = {0, \(-2\), 4}; 

Clear[line1, line2, s, t]; 

    line1[t_] = point1 + t\ X1; 
line2[s_] = point2 + s\ X2; 


    line1plot = 
      ParametricPlot3D[line1[t], {t, \(-2\), 2}, 
        DisplayFunction -> Identity]; 

    \(line2plot = 
      ParametricPlot3D[line2[s], {s, \(-1\), 1}, 
        DisplayFunction -> Identity]; \)\)\(threedims = Axes3D[2, 0.2]; 


    setup = Show[line1plot, line2plot, threedims, ViewPoint -> CMView, 
        Boxed -> False, DisplayFunction -> $DisplayFunction]; \)

The plot gives the strong hint that the lines hit each other.
Explain how the following calculation confirms that the lines do hit each other:

Solve[
      Thread[line1[t] == line2[s]][[{1, 2}
          ]], {s, t}]

Use what you see to pin down the coordinates of the point at which the lines hit each other.

G.1.d.ii)

Take another look at the lines in part i) above.

Show[setup];

The two lines also look like they cross each other at right angles (perpendicularly). Use the dot product of two well-chosen vectors to confirm or contradict this observation.

G.1.d.iii)

Here are plots of two new lines in three dimensions:

point1 = {1, 1, 1}; point2 = {2, 1.5, 1.5}; X1 = {2, 2, 1}; \(X2 = {0, \(-2\), 4}; 

Clear[line1, lin2, s, t]; 

    line1[t_] = point1 + t\ X1; 
line2[s_] = point2 + s\ X2; 


    line1plot = 
      ParametricPlot3D[line1[t], {t, \(-2\), 2}, 
        DisplayFunction -> Identity]; 

    \(line2plot = 
      ParametricPlot3D[line2[s], {s, \(-1\), 1}, 
        DisplayFunction -> Identity]; \)\)\(threedims = Axes3D[3, 0.2]; 


    setup = Show[line1plot, line2plot, threedims, ViewPoint -> CMView, 
        Boxed -> False, DisplayFunction -> $DisplayFunction]; \)

The plot hints that these two lines hit each other.
Do they?

G.1.e)

You can think of the CMView = {2.7, 1.6, 1.2} as a three-dimensional vector.
Here is this vector shown with ViewPoint -> CMView:

CMView = {2.7, 1.6, 1.2}; X = CMView; spacer = 0.2; h = 1; \(threedims = Axes3D[h, \ spacer]; 


    Show[Arrow[X, Tail -> {0, 0, 0}, VectorColor -> Red], 
      threedims, PlotRange -> All, ViewPoint -> CMView, 
      Boxed -> False]; \)

Gotcha!
Here is X = CMView from some other viewpoints:

NewView = {10, 0, 0}; Show[Arrow[X, Tail -> {0, 0, 0}, VectorColor -> Red], 
      threedims, PlotRange -> All, ViewPoint -> NewView, 
      Boxed -> False];

NewView = {2, -1, 1}; Show[Arrow[X, Tail -> {0, 0, 0}, VectorColor -> Red], 
      threedims, PlotRange -> All, ViewPoint -> NewView, 
      Boxed -> False];

Here is the vector X = CMView = {2.7, 1.6, 1.2}  shown with a squadron of its transplants with ViewPoint -> CMView:

Clear[tail, k]; tail[1] = {0, 0, 0}; tail[2] = {2, 0, 0}; tail[3] = {0, 2, 0}; tail[4] = {0, 0, 2}; tail[5] = {-2, 0, 0}; tail[6] = {2, 2, 0}; \(squadron = 
      Table[Arrow[X, Tail -> tail[k], VectorColor -> Red], {k, 1, 
          6}]; 
Show[squadron, threedims, PlotRange -> All, 
      ViewPoint -> CMView, Boxed -> False]; \)

Duck before they pin you to your chair.
Play with the plots above until you get to the point at which you can explain what the viewpoint specification in a three-dimensional plot actually does. Then write up your own explanation of what you think the viewpoint specification in a three-dimensional plot actually does for you.

G.2)  Measurements*

G.2.a)

Measure the distance between {2, 7} and {3, -5} in two dimensions.
Measure the distance between {2, 7, -8} and {3, -5, 9} in three dimensions.

G.2.b.i)

Here is a triangle sitting happily in three dimensions:

point1 = {0, 2, -4}; point2 = {-(6/5), (41/10), -(5/2)}; point3 = {1, 0, 5}; triangle = Graphics3D[Polygon[{point1, point2, point3}]]; \(threedims = Axes3D[2, 0.2]; 


    Show[threedims, triangle, ViewPoint -> CMView, 
      PlotRange -> All, Boxed -> False]; \)

That triangle sure looks like a right triangle.
Use a dot product to confirm or dispel this observation.

G.2.b.ii)

Mrs. Stephens is one of those sly math teachers who uses Mathematica in her office but doesn't allow the students to use computers or calculators for class work. In fact, she doesn't even let her students know that she even has a computer. 
In preparation for yet another captivating lecture, she needs to generate a right triangle in three dimensions with one vertex at {0, 0, 0}. 
She locks her office and gets out her computer and types:

X = {1, 2, 3}; Y = {0, 1, 1}; point1 = {0, 0, 0}; point2 = X; \(point3 = \(X . Y\/Y . Y\) Y; 

    triangle = Graphics3D[Polygon[{point1, point2, point3}]]; 

    threedims = Axes3D[2, 0.2]; 


    Show[threedims, triangle, ViewPoint -> CMView, 
      PlotRange -> All, Boxed -> False]; \)

She knows in advance that, unless X and Y are parallel vectors, the triangle with vertices (corners) at {0, 0, 0}, the tip of 
       X . (Y/Y) . Y Y  (with tail at {0, 0, 0}) 
and the tip of X (with tail at {0, 0, 0}) will always give her a right triangle.
Why does this always work?

G.2.c)

Here is a plot of a line and a point:

\(Clear[L, t]; 

    L[t_] = {\(-1.3\), 5.6, \(-1.8\)} + t\ {1.2, 7.3, \(-3.6\)}; 

    \(point = {2.4, 0.7, \(-0.2\)}; \)\)lineplot = 
      ParametricPlot3D[L[t], {t, -1, (1/2)}, 
        DisplayFunction -> Identity]; \(threedims = Axes3D[2.5, 0.2]; 

    \(Show[threedims, lineplot, 
      Graphics3D[{Red, PointSize[0.02], Point[point]}], 
      ViewPoint -> CMView, PlotRange -> All, Boxed -> False, 
      DisplayFunction -> $DisplayFunction]; \)\)

Measure the shortest distance between the line and the point.

The distance between L[t] and the point is measured by:

dist[t_] = (Sqrt[(L[t] - point) . (L[t] - point)])

G.3)  With or against?*

G.3.a.i)

Here are two vectors X and Y:

X = {-0.5, 2}; Y = {-2, 1}; Show[Arrow[X, Tail -> {0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> {0, 0}, VectorColor -> Red], 
      Graphics[{{Text["X", (X/2)]}, {Text["Y", (Y/2)]}}], 
      Axes -> Automatic, AspectRatio -> Automatic];

How does the picture reveal with no calculation that X . Y > 0?
Confirm what you say by calculating X . Y.
Add to the plot the vector that measures the push of X in the direction of Y.
Would you say that the push of X in the direction of Y is with Y or against Y?

G.3.a.ii)

Here are two new vectors X and Y:

X = {2, 2}; Y = {-3, 1}; Show[Arrow[X, Tail -> {0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> {0, 0}, VectorColor -> Red], 
      Graphics[{{Text["X", (X/2)]}, {Text["Y", (Y/2)]}}], 
      Axes -> Automatic, AspectRatio -> Automatic];

How does the picture reveal with no calculation that X . Y < 0?
Confirm what you say by calculating X . Y.
Add to the plot the vector that measures the push of X in the direction of Y.
Would you say that the push of X in the direction of Y is with Y or against Y?

G.3.a.iii)

Given any two vectors X and Y, how does the sign of the dot product X . Y tell you whether the push of X in the direction of Y is with Y or against Y?

G.3.b)

At time t with 0 ≤ t ≤ 2  π, Luke Skywalker is at the point 
       {x[t], y[t]} = {Cos[t], 3  Sin[t]}.  
Darth Vader has activated a force field that puts a force (= push or pull) equal to {x, -y} on any object at {x, y}.
At time t:
-> Is the force pushing with or against Skywalker's movement if
       {x[t], -y[t]}.{x'[t],y'[t]}<0?
-> Is the force pushing with or against Skywalker's movement if
       {x[t], -y[t]}.{x'[t],y'[t]}>0?
For approximately which t's is Vader's force with young Skywalker?

Plot {x[t], -y[t]}.{x'[t],y'[t]}.

G.3.c)

Here is a pair of vectors.

X = 3 {Cos[(π/3)], Sin[(π/3)]}; Y = {Cos[(π/6)], Sin[(π/6)]}; Show[Arrow[X, Tail -> {0, 0}, VectorColor -> Red], 
      Arrow[Y, Tail -> {0, 0}, VectorColor -> Red], 
      Graphics[{{Text["X", (X/2)]}, {Text["Y", (Y/2)]}}], 
      Axes -> Automatic, AspectRatio -> Automatic];

Come up with vectors U and V with:
-> U parallel to Y
-> V perpendicular to Y
-> X = U +  V.
Once you have your vectors U and V, add them to the plot above by plotting U with its tail at {0, 0}, and V with its tail at the tip of U.
Describe what you see.

G.4)  Velocity and acceleration*

G.4.a)

At time t with 0 ≤ t ≤ 6, an object is at the position 
        P[t] = {Cos[t], Cos[2  t] Sin[t]}. 
Plot the curve and some of its velocity vectors and acceleration vectors at a selection of points.
Use your plot to analyze the direction and the speed of the object.
Then plot its speed as a function of t.

G.4.b)

Ballistic projectiles (like a cannonball from a cannon) fired from the origin with muzzle velocity (Subscript[v, 0])(ft/sec) and angle b with the horizontal are at the position 
       P[t] = {(Subscript[v, 0]) Cos[b] t, (Subscript[v, 0]) Sin[b] t -  16  (t^2)}
t seconds after firing.
Take (Subscript[v, 0]) = 180(ft/sec) and b = (π/3) and plot the trajectory, some of its velocity vectors, and some of its acceleration vectors at a selection of points.
Explain anything of interest you note.

G.4.c)

For 
       P[t] = {2  Sin[t], 6  Sin[(t/2)]^2, 3  Cos[t]},
plot in true scale the motion of the object for 1 ≤ t ≤ 6, including several velocity vectors.
Then, on a separate plot, show the motion of the object for 1 ≤ t ≤ 6, including several tangential components of acceleration.
On a third plot, show the motion of the object for 1 ≤ t ≤ 6, including several tangential and normal components of acceleration.
Discuss what each plot reveals.

G.4.d.i)

An object is at 
       P[t] = {9  Sin[t], 3  Cos[t]} 
at time t.  
Plot in true scale the motion of the object for 0 ≤ t ≤ ((2  π)/3)including several velocity vectors.
Then, on a separate plot, show in true scale the motion of the object for 0 ≤ t ≤ ((2  π)/3)including several tangential and normal components of acceleration.
Discuss what each plot reveals.
Finally, show the plots together and discuss relations between them.

G.4.d.ii)

For 0 ≤ t ≤ ((2  π)/3)the object in part i) is constrained to move on an ellipse.  Suppose, at the instant t = ((2  π)/3) the object is released from all constraints and allowed to move of its own free will independent of any accelerations due to forces. Plot the path the object takes.

Does it continue along on the ellipse or does it do something else?

G.4.d.iii)

The speed of the object in part i) at time t is defined to be the length of the velocity vector at time t; in other words
       speed[t] = (Sqrt[velocity[t] . velocity[t]]).
Put 
       unittan[t] = tan[t]/(Sqrt[tan[t] . tan[t]]) 
where 
       tan[t]={x'[t],y'[t]}
Calculate D[speed[t], t] and compare it with
       acceleration[t] . unittan[t].
Try to explain why you think that the result is natural or weird.

G.4.d.iv)

If you know speed[0], then how do you give a formula for speed[t] in terms of acceleration[t] . unittan[t]?

Two-four-six-eight,
What do you integrate?

G.4.d.v)

Can you get any information about speed[t] if you know the tangential component of acceleration but lose all your information about the normal component of acceleration?

G.5)  The coordinate axes and coordinate planes in three dimensions*

Here are the three coordinate axes in three dimesnsions:

\(threedims = Axes3D[1, 0.2]; 

    Show[threedims, ViewPoint -> CMView, Boxed -> False]; \)

Here is the positive x-axis shooting out in the direction of the vector {1, 0, 0}:

xaxis = Graphics3D[{Red, Line[{{0, 0, 0}, {5, 0, 0}}]}]; Show[xaxis, threedims, ViewPoint -> CMView, 
      Boxed -> False];

Here is the positive y-axis shooting out in the direction of the  vector {0, 1, 0}:

yaxis = Graphics3D[{Red, Line[{{0, 0, 0}, {0, 5, 0}}]}]; Show[yaxis, threedims, ViewPoint -> CMView, 
      Boxed -> False];

G.5.a)

Give a plot of the positive z-axis shooting out in the direction of the vector {0, 0, 1}.
Then show all three axes in one plot.
Continue to use the option ViewPoint -> CMView.

G.5.b)

The xy-plane is the plane that you get by laying down a rigid flat sheet on the girders defined by the x-axis and the y-axis.
Here is a piece of it:

h = 2; xyplane = 
      Graphics3D[Polygon[{{0, 0, 0}, {h, 0, 0}, {h, h, 0}, {0, h, 0}}]]; 
    Show[xyplane, threedims, ViewPoint -> CMView, 
      Boxed -> False];

The xz-plane is the plane that you get by nailing a rigid flat sheet on the girders defined by the x-axis and the z-axis.
Here is a piece of it:

h = 2; xzplane = 
      Graphics3D[Polygon[{{0, 0, 0}, {0, 0, h}, {h, 0, h}, {h, 0, 0}}]]; 
    Show[xzplane, threedims, ViewPoint -> CMView, 
      Boxed -> False];

Show a piece of the yz-plane together with the coordinate vectors.
Continue to use the option ViewPoint -> CMView.

G.5.c)

Here is a curve and its shadow in the xy-plane cast by light rays shining from top to bottom, all parallel to the z-axis.

\(Clear[t, x, y, z]; 
    
{x[t_], y[t_], z[t_]} = {1 + Cos[2\ t], t, 2 + Sin[2\ t]}; 


    curve = ParametricPlot3D[{x[t], y[t], z[t]}, {t, 0, 2\ π}, 
        DisplayFunction -> Identity]; 

    samplelightray = 
      Arrow[{0, 0, \(-1\)}, Tail -> {1, π, 4}, 
        VectorColor -> Red]; 
h = 2; 

    \(xyplane = 
      Graphics3D[
        Polygon[{{0, 0, 0}, {h, 0, 0}, {h, π\ h, 0}, {0, π\ h, 0}}]]; 
    \)\)\(shadowonxy = 
      ParametricPlot3D[{x[t], y[t], 0}, {t, 0, 2\ π}, 
        DisplayFunction -> Identity]; 


    Show[curve, samplelightray, xyplane, shadowonxy, threedims, 
      ViewPoint -> CMView, Boxed -> False, Axes -> None, 
      DisplayFunction -> $DisplayFunction]; \)

Plot the same curve and its shadow in the xz-plane cast by light rays shining from right to left, and all parallel to the y-axis.
Then plot the same curve and its shadow of the yz-plane cast by light rays shining from front to back, and all parallel to the x-axis.
Continue to use the option ViewPoint -> CMView.

G.6)  Serious plotting: Parametric planets

Many persons wonder why astronomers of antiquity had so much trouble predicting the paths of the planets.  The truth is that their view that the Earth was the center of the solar system made the job of charting the motion of the other planets very, very difficult. 
To see why, take a look at a simplified version of the Sun-Earth-Mars system.
Here are some simplified data:
-> Both the Earth and Mars move on orbits that are nearly circular, and both orbits are in the same plane.
-> One astronomical unit is the distance from the Earth to the Sun. 
-> Mars is about 1.52 times as far from the Sun as is the Earth.  
-> Mars takes about 2 (Earth) years to orbit the sun; the Earth takes one year.
Setting the Sun at the origin, measuring distance in astronomical units, and measuring time t in Earth years with the Earth and Mars in alignment on the x-axis when t = 0, you can give a pleasing plot of the motion during the first nine months of the first year.

\(Clear[earth, mars, t]; 

    earth[t_] = {Cos[2\ π\ t], Sin[2\ π\ t]}; 

    mars[t_] = 1.52\ {Cos[2\ π  t\/2], Sin[2\ π\ t\/2]}; 


    orbits = ParametricPlot[{earth[t], mars[t]}, {t, 0, 9\/12}, 
        PlotStyle -> {{Thickness[0.01], Blue}, {Thickness[0.01], Red}}, 
        AspectRatio -> Automatic, 
        Epilog -> Text["Earth-Mars-Sun", {0, 0.4}], 
        DisplayFunction -> Identity]; 


    sun = Graphics[{RGBColor[1, 0.5, 0], PointSize[0.06], Point[{0, 0}]}]; 

    
ninemonths = 
      Show[orbits, sun, DisplayFunction -> $DisplayFunction]; \)

That's the sun in the center, Mars on the outside track, and Earth on the inside track.
Here's a little movie that illustrates the action:

\(Clear[pointers, t]; 

    pointers[t_] := {
        Arrow[earth[t], Tail -> {0, 0}, VectorColor -> Blue], 
        Arrow[mars[t], Tail -> {0, 0}, VectorColor -> Red]}; 

    Table[Show[ninemonths, pointers[t]], {t, 0, 9\/12, 9\/\(12\ 4\)}]; \)

Here's a little movie that shows the movement of Earth and Mars:

\(Clear[earthplotter, marsplotter, t]; 

    earthplotter[t_] := Graphics[{Blue, PointSize[0.03], Point[earth[t]]}]; 

    \(marsplotter[t_] := Graphics[{Red, PointSize[0.03], Point[mars[t]]}]; 
    \)\)jump = (2/9); Table[
      Show[sun, earthplotter[t], marsplotter[t], 
        PlotRange -> {{-2, 2}, {-2, 2}}], {t, 0, 2 - jump, 
        jump}];

To see why the oldtimers who insisted that the Earth is at the center of the solar system had some tough explaining to do, you look at a plot of the movement of Mars and the Sun with the Earth plotted at {0, 0}.
To see how to do this, look at:

\(Clear[t, earthtosun, earthtomars]; 

    earthtosun[t_] = {0, 0} - earth[t]; 

    \(earthtomars[t_] = mars[t] - earth[t]; \)\)t = 0.3; Show[ninemonths, marsplotter[t], earthplotter[t], 
      Arrow[earthtosun[t], Tail -> earth[t], VectorColor -> Blue], 
      Arrow[earthtomars[t], Tail -> earth[t], VectorColor -> Red]];

Change t and rerun. 
To plot the motion of Mars and the Sun with the earth at {0, 0}, you just put the tails of the vectors earthtomars[t] and earthtosun[t] at {0, 0} and plot the curves traced out by their tips as t advances from 0.  Here's what you get for the first two years:

\(Clear[t]; 

    ParametricPlot[{earthtomars[t], earthtosun[t]}, {t, 0, 2}, 
      PlotStyle 
        -> {{Thickness[0.01], Red}, {Thickness[0.01], 
            RGBColor[1, 0.5, 0]}}, AspectRatio -> Automatic, 
      Epilog -> {
          Text["Earth-Mars-Sun with Earth at center", {\(-1\), 0.4}], {
            Blue, PointSize[0.04], Point[{0, 0}]}}]; \)

The sun goes around the Earth in a nice circle, but look at the catchy dance Mars is doing.  No wonder the ancient astronomers had a lot of trouble predicting and explaining where Mars was going.

G.6.a)

Explain the presence of the number 2 in the denominators inside the original parametric formula
       mars[t] = 1.52 {Cos[2  π  (t/2)], Sin[2  π  (t/2)]}.

G.6.b)

Set Mars at {0, 0} and plot the motion of Earth for the first two years.

G.6.c)

-> Jupiter sits 5.20 times as far from the Sun as does the Earth.  
-> It also moves in a (nearly) circular orbit in the plane of the Earth's orbit.
-> Jupiter takes about 12 Earth years to complete one trip around the Sun.
Setting the Earth at {0, 0}, measuring distance in astronomical units, and measuring time t in Earth years with the Earth and Jupiter in alignment on the x-axis when t = 0, give a plot of the motion of Jupiter during the first five Earth years.

G.6.d)

Comment on the following sentiment:
The old timers were not wrong in saying that the Sun goes around the Earth, but their insistence that this is the only way to look at the solar system was wrong and held back science for many years.

G.6.e) Orbiting around a moving object

Just to see whether you got the idea, look at the following plots of two objects. At time t, object1 is at the point 
       {Sin[t] (1 -  Cos[t]), Cos[t] Cos[4  t]} 
and object2 is at the point 
       {Sin[t] (1 -  Cos[t]), Cos[t] Cos[4  t]} +  
        0.5 {Cos[t], Sin[t]}

\(Clear[object1, object2, t]; 

    object1[t_] = {Sin[t]\ \((1 - Cos[t])\), Cos[t]\ Cos[4\ t]}; 

    object2[t_] = object1[t] + 0.5\ {Cos[2\ t], Sin[2\ t]}; 


    ParametricPlot[{object1[t], object2[t]}, {t, 0, 2\ π}, 
      PlotStyle -> {{Thickness[0.02]}, {Red, Thickness[0.01]}}, 
      AxesLabel -> {"x", "y"}]; \)

What a mess! 
Plot the motion of object2 when you place object1 at {0, 0} and use what you see to explain what's happening.

G.7)  Lines*

G.7.a)

Here is the line segment running from {-3, 2} to {3, -4}.

point1 = {-3, 2}; point2 = {3, -4}; segment = 
      Show[Graphics[{PointSize[0.02], Blue, Point[point1], Point[point2]}], 
        Graphics[Line[{point1, point2}]], Axes -> Automatic, 
        AxesOrigin -> {0, 0}, AxesLabel -> {"x", "y"}];

A parametric formula of the line through these two points is:

\(Clear[L, t]; 
L[t_] = point1 + t\ \((point2 - point1)\)\)

What value of t makes L[t] land on point1?
What value of t makes L[t] land on point2?
What value of t makes L[t] land on the point halfway between point1 and point2 on the indicated segment? 
What values of t make L[t] land on the indicated segment?
Illustrate with plots similar to these:

Show[segment, 
      Arrow[L[0.57], Tail -> {0, 0}, VectorColor -> Red]];

Show[segment, 
      Arrow[L[1.46], Tail -> {0, 0}, VectorColor -> Red]];

G.7.b.i)

Write down a parametric formula for the line that passes through the points {2, 0} and {3, 4}. 
Give a vector parallel to this line.
Give a vector perpendicular to this line.

G.7.b.ii)

Write a parametric formula for the line that has xy-equation 
       (y +  2) = 1.52 (x -  1).
Give a vector parallel to this line.
Give a vector perpendicular to this line.
Give a point on this line.

G.7.b.iii)

Are the lines with parametric formulas
       (Subscript[L, 1])[t] = {2, 3} +  t {-3, 5}
and
       (Subscript[L, 2])[t] = {2, 3} +  t {6, -10}
the same line or different lines?
Are the lines with vector equations
       (Subscript[L, 1])[t] = {2, 3} +  t {-3, 5}
and
       (Subscript[L, 2])[t] = {-4, 13} +  t {-3, 5}
the same line or different lines?

G.7.c.i)

Give a parametric formula for the line passing through the point {1, 4, 5} and moving away in the direction of the vector {2, 1, 1}.

G.7.c.ii)

Give a parametric formula for the line in three dimensions through the tips of the vectors X = {2, 6, 2} and Y = {4, 2, 1} when their tails are at the origin.

G.7.d)

Parametric equations for the line through {1, 2, 3} parallel to the vector {5, 6, -4} are
       x = 1 +  5  t,
       y = 2 +  6  t, and
       z = 3 -  4  t.
A friend taking the old-fashioned course tells you that the xyz-equations for this line are
       ((x  -  1)/5)=((y  -  2)/6)=((z  -  3)/(-4)).
Your friend is right.
Why?

G.8)  Lasers

G.8.a)

A Spartan missile and a Trojan missile are both flying at the same constant altitude.
At time t, the Spartan missile is at the point:

\(Clear[spartan, t]; 

    spartan[t_] = {16.1 - 7\ t + t\^2, 13\ t - 2\ t\^2}\)

At the same time t, the Trojan missile is at the point:

\(Clear[trojan]; 

    trojan[t_] = {26 - 13\ t + 2\ t\^2, 23 - 5\ t + t\^2}\)

Here is a plot of the paths of the two missiles:

spartanpath = 
      ParametricPlot[spartan[t], {t, 0, 6}, 
        PlotStyle -> {{Blue, Thickness[0.01]}}, 
        DisplayFunction -> Identity]; \(trojanpath = 
      ParametricPlot[trojan[t], {t, 0, 6}, 
        PlotStyle -> {{Red, Thickness[0.01]}}, 
        DisplayFunction -> Identity]; 


    Show[spartanpath, trojanpath, DisplayFunction -> $DisplayFunction]; 
    \)

Their paths cross, but do they crash?

G.8.a.ii)

Continue with the set-up in part i) immediately above, but with additional information:
Each of the missiles has a laser in its nose that can shoot straight ahead and zap instantaneously.
Can either missile ever zap the other?
If so, who can zap whom and when?

Tip:

Look at:

\(Clear[s]; 
Solve[trojan[t] + s\ D[trojan[t], \ t] == spartan[t]]\)

If you use this, explain why it helps.

G.8.b)

At time t ≥ 0, your new Luke Skywalker laser rocket scooter is at the position:

\(Clear[P, t]; 

    P[t_] = {6 - t + Sin[t], 10 - 2\ t, 2 + 0.5\ Sin[2\ t]}\)

Here is its path for 0 ≤ t ≤ 5:

path = 
      ParametricPlot3D[Evaluate[P[t]], {t, 0, 5}, 
        DisplayFunction -> Identity]; h = 6; xzplane = 
      Graphics3D[
        Polygon[{{-h, 0, 0}, {-h, 0, h}, {h, 0, h}, {h, 0, 0}}]]; 
    \(threedims = Axes3D[6,  .4]; 

    \(setup = 
      Show[threedims, path, xzplane, ViewPoint -> CMView, 
        Boxed -> False, Axes -> None, PlotRange -> All, 
        DisplayFunction -> $DisplayFunction]; \)\)

A laser beam emanates from the nose cone of your scooter and shoots out in a straight line tangent to the path like this:

time = 3.3; samplebeam=Arrow[ P'[time],Tail -> P[time],VectorColor -> Red,ScaleFactor -> 4.5];
Show[setup, samplebeam];

Note that the beam pierces the xz-plane.
Imagine that the xz-plane is made of cardboard, and plot the curve burned into the xz-plane by your scooter's laser during the time interval 0 ≤ t ≤ 5.

Look at:

P[t]+s P'[t]

(P[t]+s P'[t])[[2]]

Solve[(P[t]+s P'[t])[[2]]==0,s]

G.9)  Parabolic reflectors, spherical reflectors, and elliptical reflectors

G.9.a.i) Parabolic reflectors

Here is part of the parabola 
       f[x]=((x^2)/8):

\(Clear[f, x]; 
f[x_] = x\^2\/8; 
{x[t_], y[t_]} = {t, f[t]}; 


    parabola = 
      ParametricPlot[{x[t], y[t]}, {t, \(-4\), 4}, 
        PlotStyle -> {{Blue, Thickness[0.01]}}, 
        AxesLabel -> {"x", "y"}]; \)

Three vertical light rays, emanating from 
       {x[1], 6}, {x[2], 6}, and {x[3], 6}, 
hit the parabola at the points 
       {x[1], y[1]}, {x[2], y[2]}, and {x[3], y[3]} 
respectively:

\(Clear[beam]; 

    beam[t_] := 
      Arrow[{x[t], y[t]} - {x[t], 6}, Tail -> {x[t], 6}, 
        VectorColor -> Red]; 

    Show[parabola, beam[1], beam[2], beam[3], PlotRange -> All]; \)

On one plot, show the paths the three beams take after they have bounced off the parabola. Make sure you show enough of the reflected beams to see where each beam crosses the y-axis.
Describe what you see, and mention anything interesting.

G.9.a.ii)

You are given a positive number p, but you are not told what the specific value of p is.
A vertical light beam comes from high above the plot of 
       f[x]=((x^2)/(4  p))
and bounces off the curve at a given point point {a, f[a]}. You are not told what the specific value of a is.
Calculate in terms of p the point at which the reflected beam crosses the y-axis.

G.9.a.iii)

Most traditional reference books say that the focus of the parabola            
       f[x]=((x^2)/(4  p))
is located at the point {0, p} on the vertical-axis.  Why do they say this?
Why do folks use parabolas to build television satellite dish antennas to sell to rednecks in the boonies who want to watch wrestling and roller derby?
The great Greek scientist, Archimedes (287-212 B.C.), was the first scientist to understand what parabolic mirrors can do.  In fact, Archimedes once used parabolic mirrors to concentrate sunlight on the sails of attacking Roman ships, thereby burning them up before they could attack. How do you think Archimedes went about this?

You'll have trouble with this if your answer to part ii) above isn't correct.

G.9.b) Spherical reflectors

Here is part of the circle of radius 4 centered at {0, 4}:

\(Clear[x, y, t]; 
{x[t_], y[t_]} = {0, 4} + 4\ {Cos[t], Sin[t]}; 

    \(starter = \(3\ π\)\/2 - π\/3; \)\)\(stopper = \(3\ π\)\/2 + π\/3; 


    circulardish = 
      ParametricPlot[{x[t], y[t]}, {t, starter, stopper}, 
        PlotStyle -> {{Blue, Thickness[0.01]}}, 
        AspectRatio -> Automatic, AxesLabel -> {"x", "y"}]; 
    \)

Three vertical light rays, emanating from 
       {x[5], 6}, {x[5.3], 6}, and {x[5.6], 6}, 
hit the circular dish at the points 
       {x[5], y[5]}, {x[5.3], y[5.3]}, and {x[5.6], y[5.6]},
respectively:

\(Clear[beam]; 

    beam[t_] := 
      Arrow[{x[t], y[t]} - {x[t], 6}, Tail -> {x[t], 6}, 
        VectorColor -> Red]; 


    Show[circulardish, beam[5], beam[5.3], beam[5.6], 
      AspectRatio -> Automatic, PlotRange -> All]; \)

On one plot, show the path each of the three beams takes after it has bounced off the circle.  Make sure you show enough of the reflected beams to see where each beam crosses the y-axis.
Why don't spherical dish antennas work very well?

G.5.c.i) Elliptical reflectors

Here is the lower half of the ellipse
       ((((x/3)))^2) +  ((((y/2)))^2) = 1
shown with its two focuses at 
       {(Sqrt[(3^2) -  (2^2)]), 0} and {-(Sqrt[(3^2) -  (2^2)]), 0}:

\(Clear[x, y, t]; 
a = 3; 
\(b = 2; \)\){x[t_], y[t_]} = {a Cos[t], b Sin[t]}; starter = π; stopper = 2 π; leftfocus = {-(Sqrt[(a^2) - (b^2)]), 0}; \(rightfocus = {\@\(a\^2 - b\^2\), 0}; 


    ellipticaldish = 
      ParametricPlot[{x[t], y[t]}, {t, starter, stopper}, 
        PlotStyle -> {{Blue, Thickness[0.01]}}, 
        AspectRatio -> Automatic, AxesLabel -> {"x", "y"}, 
        Epilog -> {{PointSize[0.04], Point[leftfocus]}, {
              PointSize[0.04], Point[rightfocus]}}]; \)

Three light rays emanating the left focus hit the elliptical dish at the points 
       {x[4], y[4]}, {x[5], y[5]}, and {x[6], y[6]}:

\(Clear[beam]; 

    beam[t_] := 
      Arrow[{x[t], y[t]} - leftfocus, Tail -> leftfocus, 
        VectorColor -> Red]; 


    Show[ellipticaldish, beam[4], beam[5], beam[6], PlotRange -> All]; 
    \)

On one plot, show the path each of the three beams takes after it has bounced off the ellipse.  Make sure you show enough of the reflected beams to see where each beam crosses the x-axis.
Describe what you see.

G.9.c.ii)

The ceiling of the rotunda in the United States Capitol building in Washington D.C. is in the form of an elliptical dish.  Tourists are often surprised that they can sometimes hear very clearly what strangers well across the room are saying.
Use what you did above to explain this spooky phenom.

G.9.c.iii)

Lewis Carroll (actual name Charles Dodgson, 1832 - 1898) was one far-out fellow. In addition to writing the famous tale of "Alice in Wonderland," he was an accomplished mathematician and logician.  As a prank, he invented an elliptical pool table with a mark at one focus and a hole at the other focus and challenged expert pool players to sink more balls in the holes than he.
What advantage did he have over those who didn't know about reflecting properties of ellipses?

One of the authors of C&M once found an elliptical pool table in the back corner pool hall and challenged others to play. The games on the elliptical pool table were the only games he won that night.

G.10) Pursuits by a robotic cowhand

The scene is the C&M Electronic Ranch, where all the cattle are prize winners and where electronic robots do all the work.  
One night, the prize bull breaks out of the pen, meanders around the ranch grounds, and then heads for the gate to the highway on the path plotted below:

\(Clear[bull, t]; 

    bull[t_] = 4\ {1 + 0.1\ t + Cos[0.3\ t], 6 - 0.05\ t + Sin[0.4\ t]}; 


    bullroute = 
      ParametricPlot[bull[t], {t, 0, 60}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity, 
        Epilog -> Text["Bull route", {25, 30}]]; 

    \(pointplot = {Graphics[{PointSize[0.06], Point[bull[0]]}], 
        Graphics[{PointSize[0.06], Point[bull[60]]}], 
        Graphics[{PointSize[0.05], Point[{2, 3}]}]}; \)\)\(labels = {Graphics[Text["Bull at t = 0", bull[0], {0, \(-4\)}]], 
        Graphics[Text["Gate to highway", bull[60], {0, 3}]], 
        Graphics[Text["Robot at t = 0", {2, 3}, {0, \(-2\)}]]}; 


    setup = Show[bullroute, pointplot, labels, PlotRange -> All, 
        AxesOrigin -> {0, 0}, AspectRatio -> Automatic, 
        DisplayFunction -> $DisplayFunction]; \)

At time t = 0, the robot is at position {2, 3} on the plot above.
The robot is programmed to move so that if the robot's position at time t is {x[t], y[t]}, then the robot's velocity vector at that time is
       {x'[t], y'[t]} = r (bull[t] -  {x[t], y[t]})
where r is a positive number yet to be determined.
This is good because:
-> The robot is always moving toward the bull. 
-> The robot slows down when it gets near the bull so that the robot neither smashes into the bull nor stampedes the bull.

G.10.a.i)

Given that the robot can lasso the bull anytime the robot gets within 4.5 yards of the bull, your job is to come up with a specific positive number r, as small as practical, so that the robot will be successful lassoing the bull before the bull gets to the gate to the highway.

One way to go about this problem is by trial and error with different r's.
The distance between the bull and the robot at time t is 
       dist[t] = 
        (Sqrt[(bull[t] - {x[t], y[t]}) . 
            (bull[t] - {x[t], y[t]})]).
To check out a guess for a good r, you might want to plot dist[t].

G.10.a.ii)

After you have settled on a good number r in part i), make a nice plot of the actual lassoing of the bull by the robot.

Tip:

You can use 
       lassorad = Graphics[Circle[{a, b}, 4.5]] 
to plot a circle of radius 4.5 centered on {a, b}.

G.11)  Stealth technology

G.11.a)

Here is the curve y = 1 -  Cos[x] shown with several vertical light beams:

\(Clear[f, x, t]; 
f[x_] = 1 - Cos[x]; 
\(x[t_] = t; \)\)\(y[t_] = f[t]; 


    curve = ParametricPlot[{x[t], y[t]}, {t, \(-1\), 2}, 
        PlotStyle -> {{Thickness[0.01], Blue}}, 
        AxesLabel -> {"x", "f[x]"}, 
        DisplayFunction -> Identity]; 

    beams = Table[
        Arrow[{x[t], y[t]} - {x[t], 3}, Tail -> {x[t], 3}, 
          VectorColor -> Red], {t, \(-1\), 2, 3\/8}]; 


    setup = Show[curve, beams, DisplayFunction -> $DisplayFunction]; 
    \)

Throw the plots of the reflected light into the plot, and use your plot to study the question:
Which parts of the curve plotted above are good at concentrating the reflected light? Which parts are not so good?

G.11.b)

Stealth bombers and fighters were designed to try to resist detection by radar.  When they were first unveiled, lots of folks asked why the skin of the planes is made with flat panels and absolutely no curved indentations. Look at your answer to part a), turn on your brain, and speculate about why stealth bombers and fighters are designed this way.