Calculus: The Language of Change

Exercise Set 16.1
The Vector Parametric Line

solutions by Randall Childs and David Theobald

Special Mathematica Functions used in this NoteBook

We told you not to look.  This horrible stuff sets various defaults and defines some functions needed to draw the geometric side of the lexicon.  Ignore the details here and go on to the lesson.

Off[General::spell];
Off[General::spell1];
Off[ParametricPlot3D::ppcom]
Needs["Graphics`Colors`"]

SetOptions[Graphics,Axes->False,AxesOrigin->{0,0},AspectRatio->Automatic];
SetOptions[Graphics3D,ViewPoint->{5,2,1},Boxed->False,AspectRatio->Automatic];
SetOptions[ParametricPlot3D,ViewPoint->{5,2,1},AspectRatio->Automatic];
SetOptions[Plot3D,ViewPoint->{5,2,1},AspectRatio->Automatic];
SetOptions[ParametricPlot,AspectRatio->Automatic];
SetOptions[Plot,AspectRatio->Automatic];

colorQ[a_]:=(Head[a]===RGBColor);
grayQ[a_]:=(Head[a]===GrayLevel);
thickQ[a_]:=(Head[a]===Thickness);
absthickQ[a_]:=(Head[a]===AbsoluteThickness);
notruleQ[u_] := !(Head[u]===Rule);
ruleQ[u_] := (Head[u]===Rule);

Norm::usage = "Norm[expr] returns the Euclidean length of the
		vector, 'expr'.";

Norm[a_?VectorQ] := Sqrt[a.a];

Angle[a_?VectorQ,b_?VectorQ] := ArcCos[(a.b)/(Norm[a] Norm[b])]

Proj[a_?VectorQ,b_?VectorQ] := ((a.b)/(b.b))b

tol = .5*10^-6;

OrthUp[a_?VectorQ] :=
	Module[{b,c,d,f},
		d = N[a/Norm[a]];
		If[Chop[d[[3]]^2 - 1,tol] == 0, b={1,0,0} ,
		b = {0,0,1} - d[[3]] d; b = b/Norm[b];];
	Return[b]];
	
OrthSet[a_?VectorQ] :=
	Module[{b,c,d},
		d = N[a/Norm[a]];
		If[Chop[d[[1]],tol]==0,b={1,0,0},
			 If[Chop[d[[2]],tol]==0,b={0,1,0},
			  b={-d[[2]],d[[1]],0}]];
			b=b/Norm[b];c = Cross[d,b];
	Return[{b,c/Norm[c],d}]];

				
Rotate[a_?VectorQ,theta_] :=
	Module[{u,v,r},
		u = OrthSet[a];
		v = Transpose[u];
		r = N[{{Cos[theta],-Sin[theta],0},{Sin[theta],Cos[theta],0},{0,0,1}}];
	Return[v.r.u]];

Vector2D[tail_,tip_,opts___]:=
	Module[{ntail,ntip,sopts,Punit,up,arrow},
	ntail = N[tail];
	ntip = N[tip];
	
	sopts = Join[Select[{opts},colorQ],Select[{opts},
				thickQ],Select[{opts},absthickQ],Select[{opts},grayQ]];

If[Chop[ntail.ntail+ntip.ntip,tol] == 0,
			(*too small to plot or not number*)
			Return[Graphics[Point[{0,0}]]];
	,						
If[Chop[(ntip-ntail).(ntip-ntail),tol] == 0,
		Return[Graphics[{Join[sopts,{Line[{ntail,ntip}]}]}]];
	,
	Punit = (.075 Norm[ntip-ntail]/Norm[ntip-ntail]) (ntip-ntail) ;
	up = 0.15 {-Punit[[2]],Punit[[1]]};
	arrow = Line[{ntail,ntip,ntip-Punit+up,ntip,ntip-Punit-up}];
	]];
Return[Graphics[{Join[{AbsoluteThickness[2]},Join[sopts,{arrow}]]}]];
];

Vector3D[tail_,tip_,opts___]:=
	Module[{ntail,ntip,sopts,Punit,up,u2,u3,u4,rotmat,arrow},
	ntail = N[tail];
	ntip = N[tip];
	
	sopts = Join[Select[{opts},colorQ],Select[{opts},
				thickQ],Select[{opts},absthickQ],Select[{opts},grayQ]];

If[Chop[ntail.ntail+ntip.ntip,tol] == 0,
			(*too small to plot or not number*)
			Return[Graphics3D[Point[{0,0,0}]]];					
	,		
If[Chop[(ntip-ntail).(ntip-ntail),tol] == 0,
		Return[Graphics3D[{Join[sopts,{Line[{ntail,ntip}]}]}]];
	,
	Punit = (ntip-ntail);
	rotmat = Rotate[Punit,N[Pi/2]];
	up = OrthUp[Punit];
	Punit = .075 Punit;
	up = .15 Norm[Punit] up;
	u2 = rotmat.up;
	u3 = rotmat.u2;
	u4 = rotmat.u3;
	arrow = Line[{ntail,ntip,
				ntip - Punit + up,ntip,
				ntip - Punit + u2,ntip,
				ntip - Punit + u3,ntip,
				ntip - Punit + u4}];
	]];
Return[Graphics3D[{Join[{AbsoluteThickness[2]},Join[sopts,{arrow}]]}]];
];

aRCtAN[y_,x_] := Module[{v},
	If[ Chop[N[x],tol] == 0 ,If[ N[y] < 0, v = -N[Pi/2], v = N[Pi/2]],
		v = N[ArcTan[y/x]];
		If[ x < 0 && y < 0, v = N[Pi -  v],v]];
	Return[v]];

Arc2D[X_,Y_,opts___] := Graphics[{opts,
		Disk[{0,0},1,{Min[
							aRCtAN[
						N[X[[2]]],N[X[[1]]]
								]
							,
							aRCtAN[
							N[Y[[2]]],N[Y[[1]]]
								]
						]
						,
					Max[
							aRCtAN[
						N[X[[2]]],N[X[[1]]]
								]
							,
							aRCtAN[
							N[Y[[2]]],N[Y[[1]]]
								]
						]}
				]}
				];
Arc3D[X_,Y_] := 
	Module[{t,U,V},
		U[V_]:= N[(1/Sqrt[V.V]) V];
		Return[Graphics3D[
		Polygon[Append[Table[U[t X + (1-t) Y],{t,0,1,0.1}],{0,0,0}]]
				]
		]
	];

(*Zero Arrow causes trouble. Put in Vector?*)

Vector[tail_,tip_,opts___]:=
	If[Length[N[tail]]==2,Return[Vector2D[tail,tip,opts]],
		Return[Vector3D[tail,tip,opts]]];
		
Arrow[vec_,opts___]:= 
	Module[{a,b},
				If[Length[N[vec]]==2,
				a=ToExpression["Tail"]/.Select[{opts},ruleQ]/.
					{ToExpression["Tail"]->{0,0}};
				Return[Vector2D[a,a+vec,opts]],
				a=ToExpression["Tail"]/.Select[{opts},ruleQ]/.
					{ToExpression["Tail"]->{0,0,0}};
				Return[Vector3D[a,a+vec,opts]]]
				];

Frame2D[delta_] := 
      Graphics[{
            {Green,Line[{{-delta/4,0},{delta,0}}]},
                    Text["x",{1.01 delta,0}],
            {Green,Line[{{0,-delta/4},{0,delta}}]},
                    Text["y",{0, 1.01 delta}]}];

Frame3D[delta_] := 
      Graphics3D[{
            {Green,Line[{{-delta/4,0,0},{delta,0,0}}]},
                    Text["x",{1.01 delta,0,0}],
            {Green,Line[{{0,-delta/4,0},{0,delta,0}}]},
                    Text["y",{0, 1.01 delta,0}],
            {Green,Line[{{0,0,-delta/4},{0,0,delta}}]},
                    Text["z",{0,0,1.01 delta}]}];

View2D[stuff_] := Show[stuff,Frame2D[1]];
View3D[stuff_] := Show[stuff,Frame3D[1]];

Exercise 1

GENERAL INSTRUCTIONS:

Plot position vectors as black arrows (with their tails at the origin, 0).  Plot displacement arrows ("free vectors") that have their tails at other places as dotted red arrows.

Warm up:	Plot A, B, (1/2)A, 3B

\(\(A = {1, 3, 2}; 
B = {\(-2\), 1, 3}; 

    View3D[{Arrow[A, Black], Graphics3D[Text["A", 1.1  A]], 
        Arrow[B, Black], Graphics3D[Text["B", 1.1  B]]}]		\)\)

\(\(View3D[{Arrow[0.5  A, Black], 
        Graphics3D[Text[\*""\!\(1\/2\)A"", 0.7  A]], 
        Arrow[3  B, Black], Graphics3D[Text["3B", 3.1  B]]}]		\)\)

(a)	3B + (1/2)A

\(View3D[{Arrow[0.5  A, Black], 
        Graphics3D[Text[\*""\!\(1\/2\)A"", 0.8  A]], 
        Arrow[3  B, Black], Graphics3D[Text["3B", 3.1  B]], 
        Arrow[3  B + 0.5  A, Black], Arrow[0.5  A, Tail -> 3  B, Red], 
        Arrow[3  B, Tail -> 0.5  A, Red]}]\)		3  B + (1/2)A

(b)	A-B

View3D[{Arrow[A, Black], Graphics3D[Text["A", 1.1  A]], 
        Arrow[B, Black], Graphics3D[Text["B", 1.1  B]], 
        Arrow[A - B, Tail -> B, Red], Arrow[A - B, Black], 
        Graphics3D[Text["A-B", 1.1  A - 1.1  B]]}]\(A - B		\)

Exercise 2

The parametric equations:

x = 3 - 4t
y = 1 + t
z = 2

define a line.  Use the vector form:

X  = P + tD

to plot it.  What are P and D?  Why does the vector form help to make the plot?  Find two nonparallel vectors M and N, both perpendicular to the direction of this line.

The vector form of these parametric equations is

X = (({{({{x}, {y}})}, {z}})) = (({{({{3}, {1}})}, {2}})) + t (({{({{-4}, {1}})}, {0}})) = P + tD

\(P = {3, 1, 2}; 
Dir = {\(-4\), 1, 0}; 

    View3D[{Arrow[P, Black], Graphics3D[Text["P", \ 1.1  P]], 
        Arrow[2  Dir, Tail -> P, Red], Arrow[\(-2\) Dir, Tail -> P, Red]}]
      \)

With the vector form of the parametric equations, one can draw the line by drawing two vectors.  One vector locates a point on the line, and the other defines the direction the line points.  No computations are required.  Using the classical form of the parametric equations requires "plotting points" which cannot be done without some computations.

To find two non-parallel vectors that are perpendicular to the direction of the line, we consult the lexicon.  It tells us that two vectors are perpendicular if their dot product is zero.  For vector D = (-4,1,0), an easy way to find one vector that satisfies the dot product condition is to choose one that is zero in the first two coordinates and non-zero in the third.  Let M = (0,0,1).  Then we have

⟨M•D⟩ = -4·0 + 1·0 + 0·1 = 0

Now consider a vector of the form N = (a,b,0).  From the dot product formula, N is perpendicular to D iff

-4·a + 1·b = 0
b = 4a

These two results give us M = (0,0,1) and N = (1,4,0) each perpendicular to D.  To see that they are not parallel, consider their dot product.  Since there is no co-ordinate for which each vector has a non-zero value, their dot product is zero.  Thus M and N are themselves perpendicular, and thus clearly not parallel.

Exercise 3

Find the parametric equations of a line through the points

Q = (({{({{-1}, {3}})}, {2}})) 	and	R = (({{({{1}, {2}})}, {3}}))

The key is to let R-Q be the direction vector.  You can use either Q or R as the position vector for the parametric equations.

\(Q = {\(-1\), 3, 2}; 
R = {1, 2, 3}; 
Dir = R - Q\)View3D[{Arrow[Q, Black], Graphics3D[Text["Q", 1.1  Q]], 
        Arrow[R, Black], Graphics3D[Text["R", 1.1  R]], 
        Arrow[Dir, Tail -> Q, Yellow], 
        Graphics3D[Text["'D'", 1.1  Q + 0.5  Dir]], 
        Arrow[2 Dir, Tail -> Q, Red], Arrow[-2 Dir, Tail -> Q, Red]}]

X = (({{({{1}, {2}})}, {3}})) + t (({{({{2}, {-1}})}, {1}}))

Exercise 4

Show that both of the following sets of parametric equations go through both of the points

R = (({{({{1}, {2}})}, {3}})) 	and	Q = (({{({{3}, {-2}})}, {1}}))

Line 1				Line 2
				x = 1 + 2t			x = 3 - s
				y = 2 - 4t			y = -2 + 2s
				z = 3 - 2t			z = 1 + s

Let t = 0.  The equations on the left yield x = 1, y = 2, and z = 3; or X = (1,2,3) = R.  Thus R lies on Line 1.

Let t = 1.  The equations on the left yield x = 1 + 2 = 3, y = 2 - 4 = -2, and z = 3 - 2 = 1; or X = (3,-2,1) = Q.  Thus Q lies on Line 1.

Let s = 0.  The equations on the right yield x = 3, y = -2, and z = 1; or X = (3,-2,1) = Q.  Thus Q lies on Line 2.

Let s = 2.  The equations on the left yield x = 3 - 2 = 1, y = -2 + 4 = 2, and z = 1 + 2 = 3; or X = (1,2,3) = R.  Thus R lies on Line 2.