02 Vector Operations

[Your name(s) here!]

Two people can do this together.  Just make sure to hand in at least one notebook with both names included.

ClearAll["Global`*"]

Computations with vectors (examples)

Execute each input cell in turn and see if the results make sense to you!

Define two vectors,  a=⟨-1,0,1⟩ and b=⟨1,1,0⟩

a={-1,0,1};b={1,1,0};

Calculate the scalar product a·b (two ways):

a.b
Dot[a,b]

Calculate ||a||, the magnitude / norm / length of a vector (three ways)

(Sqrt[a.a])
(Sqrt[Dot[a,a]])
Norm[a]

Calculate the angle between a and b: (What do you think...is the answer in radians or degrees?)

ArcCos[((a.b)/(Norm[a]Norm[b]))]

Calculate (Subscript[proj, b])(a)

Projection[a,b]

Calculate the cross product (vector product) a×b (two ways):  BTW, You get that particular × operator off the typesetting palette (the smaller ‘x’) or by typing [esc]-cross-[esc].

a\[Cross]b
Cross[a,b]

Graphing (example)

Here are those two functions to show the axes.  myAxis returns graphic primitives that create an axis in the given component direction with the given label in the given color from lo to hi; the axis is dashed for negative values.  myPoint includes dashed lines indicating how one might plot the point by hand and a label for the point.

myAxis[label_,color_,component_,lo_,hi_]:=Module[{e,g,o},
o={0,0,0};e=o;e[[component]]=1;
g={color,Text[label,1.05 hi e],Arrowheads[0.02],Arrow[{o,hi e}]};
If[lo<0,g=Join[g,{Dashed,Line[{lo e,o}],Dashing[{}]}]];
g];
myPoint[p_,color_,label_]:={color,Text[label,1.1 p],Dashed,Line[{{p[[1]],0,0},{p[[1]],p[[2]],0},p}],PointSize[Medium],Point[p],Dashing[{}]};

Draw a graph of the points and vectors a, b, and a×b along with part of the plane determined by a and b. (The vectors are all portrayed as “position vectors” with their tails at the origin.)

o={0,0,0};a={-1,0,1};b={1,1,0};
Graphics3D[
Join[
myAxis["x",Orange,1,-2,2],myAxis["y",Darker[Yellow],2,-2,2],myAxis["z",Green,3,-2,2],
myPoint[a,Black,"a"],
myPoint[b,Black,"b"],
myPoint[a\[Cross]b,Red,"a\[Cross]b"],
{
Black,Arrow[{o,a}],Arrow[{o,b}],
Red,Arrow[{o,a\[Cross]b}],
Opacity[0.5,Blue],Polygon[{a,b,-a,-b}]
}
],Axes->True,ViewPoint->{100,100,100}
]

Exercises

Exercise 1 [3 points]

In the graph above, what geometric relationships do you observe among  a, b, and a×b?

Exercise 2 [9 points]

Let a=⟨2,1,0⟩, b=⟨1,2,0⟩, and c=⟨0,1,1⟩.  Graph the parallelepiped defined by a, b, and c.  (BTW, Mathematica has a Parallelipiped [ ] function that you might be able to use. Use this together with the framework above to display axes.)

Calculate the volume (using the triple product definition of volume...) and the surface area of the parallelepiped defined by a, b, and c. (Show and label your calculations below).

Exercise 3 [9 points]

In two dimensions...
Let a=⟨2,1⟩ and b=⟨4,0⟩.  Find the vector projection of a onto b.  Graph a, b, and the projection together on the same plot.

Now find the vector projection of b onto a.  Graph a, b, and the projection together on the same plot.

Exercise 4 [3 points]

Try out L02DotProduct.nb (in our handouts folder) with “show dot product” checked.  Describe how this demonstration shows the dot product.

Exercise 5 [3 points]

Try out L02CrossProductOfVectorsInTheYZPlane.nb with “show parallelogram” checked.  What properties of the cross product does this demonstrate?