VC.01 Vectors Point the Way 
 LITERACY

\(Off[General::spell]; 
Off[General::spell1]; 

    Off[ParametricPlot3D::ppcom]; 
Off[ParametricPlot::ppcom]; 

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

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];

Spherical Setup

\(Clear[polar]; 

    polar[{x_, y_, z_}] := {\@\(x\^2 + y\^2 + z\^2\), ArcTan[y\/x], 
        ArcCos[z\/\@\(x\^2 + y\^2 + z\^2\)]}; 
Clear[X, length]; 

    length[X_] := \@\(X . X\); 
\(rr = 3; \)\)R = 5; scale = 0.8; red = RGBColor[1, 0, 0]; blue = RGBColor[0, 0, 1]; color1 = RGBColor[0.8, 0.2, 0.8]; color2 = RGBColor[0.2, 0.8, 0.2]; black = RGBColor[0, 0, 0]; \(Clear[axes]; 

    axes := Graphics3D[{Line[{X, {1.5\ rr, 0, 0}}], 
          Line[{X, {0, 1.5\ rr, 0}}], Line[{X, {0, 0, 2\ rr}}]}]; 

    Clear[xyplane]; 

    xyplane := 
      Graphics3D[
        Polygon[{{\(-2\)\ rr, \(-2\)\ rr, 0}, {\(-2\)\ rr, 2\ rr, 0}, {2\ rr, 
              2\ rr, 0}, {2\ rr, \(-2\)\ rr, 0}}]]; 
\(X = {0, 0, 0}; \)\)origin = Graphics3D[{black, Point[X]}]; Z = {2, 3, 5}; \(Clear[point]; 

    point := Graphics3D[{red, PointSize[0.03], Point[scale\ Z]}]; 

    \(Z0 = {0, 0, length[0.8\ Z]}; \)\)\(Clear[zpoint]; 
zpoint = Graphics3D[{black, Point[Z0]}]; 

    \(XY = scale\ Z\ {1, 1, 0}; \)\)\(Clear[xypoint]; 
xypoint := Graphics3D[{black, Point[XY]}]; 

    \(X0 = {length[scale\ Z\ {1, 1, 0}], 0, 0}; \)\)xpoint = Graphics3D[{black, Point[X0]}]; Y0 = {0, length[scale Z {1, 1, 0}], 0}; ypoint = Graphics3D[{black, Point[Y0]}]; \(Clear[ray]; 
ray := Graphics3D[{blue, Line[{X, scale\ Z}]}]; 

    Clear[ray1]; 
ray1 := Graphics3D[{color1, Line[{scale\ Z, Z}]}]; 

    Clear[xyray]; 
xyray := Graphics3D[{red, Line[{X, Z\ {1, 1, 0}}]}]; 

    \(rays := {ray, xyray}; \)\)xyaux = 
      ((length[0.8 Z] (0.8 Z {1, 1, 0}))/length)[0.8 Z {1, 1, 0}]; 
    \(Clear[zarc]; 

    zarc = Graphics3D[{blue, 
          Line[Table[
              \(Cos[t]\ \) {0, 0, length[0.8\ Z]} + Sin[t]\ xyaux, {t, 0, 
                \(polar[0.8\ Z]\)[[3
                  ]],  .1}]]}]; 
Clear[zarc1]; 

    zarc1 = Graphics3D[{color1, 
          Line[Table[
              \(Cos[t]\ \) {0, 0, length[0.8\ Z]} + Sin[t]\ xyaux, {t, 
                \(polar[0.8\ Z]\)[[3]], 
                1,  .1}]]}]; 
Clear[zarc2]; 

    zarc2 = Graphics3D[{color1, 
          Line[Table[
              \(Cos[t]\ \) {0, 0, length[0.8\ Z]} + Sin[t]\ xyaux, {t, 
                \(-0.8\), 0,  .1}]]}]; 
Clear[xyarc]; 

    xyarc = Graphics3D[{blue, 
          Line[Table[
              Cos[t]\ X0 + Sin[t]\ Y0, {t, 0, 
                \(polar[XY]\)[[2
                  ]],  .1}]]}]; 
Clear[xyarc1]; 

    xyarc1 = Graphics3D[{color1, 
          Line[Table[Cos[t]\ X0 + Sin[t]\ Y0, {t, \(- .5\), 0,  .1}]]}]; 

    Clear[xyarc2]; 

    xyarc2 = Graphics3D[{color1, 
          Line[Table[
              Cos[t]\ X0 + Sin[t]\ Y0, {t, 
                \(polar[XY]\)[[2]], 
                \(polar[XY]\)[[2]] + 
                  0.3,  .1}]]}]; 
Clear[stick]; 

    stick = Graphics3D[{red, Line[{scale\ Z, XY}]}]; 

    \(xaxislabel = Text["x", {0.363, 0.26}]; \)\)yaxislabel = Text["y", {0.73, 0.3}]; zaxislabel = Text["z", { .5, 0.67}]; stickplot = 
      Show[xyplane, axes, ray, point, Boxed -> False, 
        ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; rho = Text["r", {0.53, 0.45}]; rlabel = 
      Show[xyplane, axes, ray, point, Boxed -> False, 
        ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {rho, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; phi = Text["s", {0.55, 0.57}]; slabel = 
      Show[xyplane, zpoint, axes, ray, point, zarc, zarc1, zarc2, 
        Boxed -> False, ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {phi, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; theta = Text["t", { .5, 0.3}]; tlabel = 
      Show[xyplane, axes, xypoint, xpoint, ray, stick, point, xyarc, xyarc1, 
        xyarc2, Boxed -> False, ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {theta, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity]; all = 
      Show[xyplane, axes, ray, stick, point, zpoint, xpoint, xypoint, xyarc, 
        xyarc1, xyarc2, zarc, zarc1, zarc2, Boxed -> False, 
        ViewPoint -> {2.747, 1.594, 1.168}, 
        Epilog -> {theta, phi, rho, xaxislabel, yaxislabel, zaxislabel}, 
        DisplayFunction -> Identity];

Crisscross

\(Clear[x]; 

    crisscross = 
      Plot[{Cos[x], Sin[x]}, {x, π\/8, \(3\ π\)\/8}, 
        PlotStyle -> {{RGBColor[1, 0, 0], Thickness[0.02]}}, 
        Axes -> None, AspectRatio -> 1\/3, 
        DisplayFunction -> Identity]; \)

L.1)

When you plot a certain 3D vector X with its tail at {0, 0, 0}, it turns out that the tip of X is sitting on {9, -6, 4}.  When you plot the same vector with its tail at {-2, 7, 5}, where will the tip of X be?

L.2)

Given two 2D vectors X and Y, what do you get when you plot Y and X +  Y with their tails at the origin, and you plot X with its tail at the tip of Y?
Illustrate with a sketch.
What happens in 3D?

L.3)

Given two two-dimensional vectors X and Y, what do you get when you plot X and X -  Y with their tails at the origin, and you plot Y with its tail at the tip of X -  Y?
Illustrate with a sketch.
What happens in 3D?

L.4)

Here is a vector X = {5, 4} shown with its tail at {0, 0}:

X = {5, 4}; Show[Arrow[X, Tail -> {0, 0}], Axes -> True, 
      AxesLabel -> {"x", "y"}, 
      PlotRange -> {{-6, 6}, {-6, 6}}];

Add to this plot sketches of any squadron of its transplants you like, but make sure that the squadron contains some vectors with tails in each of the four quadrants.

L.5)

Given X = {1, 0, 4}, calculate 3  X.
Can you change the direction of a vector by multiplying it by a positive number?
What happens when you multiply a vector by a negative number?

L.6)

Calculate X . Y for X = {3, 8, 2} and Y = {2, -2, 5}.
What does your result tell you about these two vectors?

L.7)

Give the number t that makes X = {3, -1, 2} and Y = {1, 1, t} perpendicular.

L.8)

Here are parametric formulas for two 3D lines:       
       (Subscript[L, 1])[t] = {3, 0, 1} +  t {-2, 1, 1}, and
       (Subscript[L, 2])[t] = {3, 0, 1} +  t {1, 1, 1}.
Say how you can tell that these lines cross each other at right angles.

L.9)

You are walking along a curve and at time t you are at the location P [t] = {x[t], y[t], z[t]}. You stop at a certain time (Subscript[t, 0]) and plunk down the velocity vector 
       P' [(Subscript[t, 0])]={x' [(Subscript[t, 0])],y' [(Subscript[t, 0])],z' [(Subscript[t, 0])]} 
so that its tail is right on the point P [(Subscript[t, 0])].
Does the resulting tangent vector point forward in the direction you are going, or does it point back against the direction you are walking?

L.10)

The component of a vector X in the direction of another vector Y is given by (X . (Y/Y) . Y) Y.
What does this formula reduce to if Y is a unit vector?
(A unit vector is any vector whose length is 1.)

L.11)

Put the tail of the vector
        t {(1/(Sqrt[2])), (1/(Sqrt[2]))} = {(t/(Sqrt[2])), (t/(Sqrt[2]))}
at {0, 0} and say what t must be to make the tip of this vector as close to {1, 2.5} as it can be.

L.12)

Here are the vectors X = {(1/(Sqrt[2])), (1/(Sqrt[2]))} and Y = {1, 2.5} with their tails at {0, 0}, shown in true scale:

X = {(1/(Sqrt[2])), (1/(Sqrt[2]))}; Y = {1, 2.5}; Show[Arrow[X, Tail -> {0, 0}], Arrow[Y, Tail -> {0, 0}], 
      AspectRatio -> Automatic, Axes -> Automatic, 
      AxesLabel -> {"x", "y"}, AxesOrigin -> {0, 0}, 
      PlotRange -> {{0, 2.5}, {0, 2.5}}];

Identify X and Y, and pencil in the component of Y in the direction of X. 
Calculate the component of Y in the direction of X.

L.13)

Here is a plot of an object's path shown with two acceleration vectors with their tails at the points on the curve at which they are calculated:

\(Clear[P, t]; 
P[t_] = {2\ Sin[t] + 3, 2\ Sin[t]\ t\^2}; 

    \(path = ParametricPlot[P[t], {t, \(-\(3\/4\)\), 1.25}, 
        PlotStyle -> Thickness[0.015], 
        DisplayFunction -> Identity]; \)\)accel=Table[Arrow[((P''[s])/5),Tail -> P[s]],{s, -(1/2), 1, (3/2)}];Show[path, accel, DisplayFunction -> $DisplayFunction, 
      AspectRatio -> Automatic, PlotRange -> All, 
      AxesLabel -> {"x", "y"}, Axes -> Automatic];

The object is moving on this curve from lower left to upper right.
Pencil in the tangential and normal components of each of the two acceleration vectors in the plot.
At which of these points is the speed of the object increasing?
At which of these points is the speed of the object decreasing?

L.14)

At time t with 0 ≤ t, an object is at the position 
       P[t] = {Cos[2  t], 2  t, (e^(-2 t))}. 
Calculate its velocity, vel[t], and its acceleration, accel[t], as functions of t.

L.15)

Ballistic projectiles (like cannonballs 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. 
Calculate the acceleration vector as a function of t and explain the result.

L.16)

If X . Y > 0, then is the push of X in the direction of Y with Y or against Y?
If X . Y < 0, then is the push of X in the direction of Y with Y or against Y?

L.17)

Anywhere you happen to be, you feel a push whose direction is the same as the direction of the vector {2, 1}. Your velocity at time t ≥ 0 is given by vel[t] = {-t, (t^2)}.  For what times t ≥ 0 are you being helped by the push?  
At what times t ≥ 0 are you being hindered by the push?

L.18)

Write a parametric formula for the line that passes through the points 
       {3, 1} and {5, 11}. 
Give a vector parallel to this line.
Give a vector perpendicular to this line.

L.19)

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}]], 
        Graphics[Text["{-3,2}", point1, {-1.5, 1.5}]], 
        Graphics[Text["{3,-4}", point2, {1.5, -1.5}]], 
        Axes -> Automatic, AxesOrigin -> {0, 0}, 
        AxesLabel -> {"x", "y"}];

A parametric formula of the line through these two points is:
       L[t] = {-3, 2} +  t ({3, -4} -  {-3, 2})
What value of t makes L[t] land on {-3, 2}?
What value of t makes L[t] land on {3, -4}?
What value of t makes L[t] land on the midpoint
       (1/2) ({-3, 2} + {3, -4}) = {0, -1}
of the indicated segment?
What t's do you use to plot the indicated segment?
If you take t > 1, where will L[t] land?
If you take t < 0, where will L[t] land?

L.20)

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

L.21)

Give a parametric formula for the 3D-line through the points {2, 5, 0} and {4, 1, 3}.

L.22)

Here are two parallel circles:

top = 
      ParametricPlot3D[{Cos[s], Sin[s], 3}, {s, 0, 2 π}, 
        DisplayFunction -> Identity]; bottom = 
      ParametricPlot3D[{2 Cos[s], 2 Sin[s], 0}, {s, 0, 2 π}, 
        DisplayFunction -> Identity]; Show[top, bottom, DisplayFunction -> $DisplayFunction];

When you fix a given s with 0 ≤ s ≤ 2  π, then what happens to the points    
       \({2  Cos[s], 2  Sin[s], 0} + 
	\ \ \ \ \ \ \ \ \ \ \ \ 
        t \(({Cos[s], Sin[s], 3} - {2  Cos[s], 2  Sin[s], 0})\)\)
 as you run t from 0 to 1? 
 Use your answer to predict the output from:

ParametricPlot3D[{2 Cos[s], 2 Sin[s], 0} + 
        t ({Cos[s], Sin[s], 3} - {2 Cos[s], 2 Sin[s], 0}), {s, 0, 
        2 π}, {t, 0, 1}];