Two Vector products

MAT 229, Spring 2025

Supporting materials

If you wish to get a different perspective on the notes below, try either of the following textbook sections.

Strang’s Calculus
	Vol. 3, 2.3: The Dot Product and Vol. 3, 2.4: The Cross Product

Stewart’s Calculus
	Section 12.3: Dot product and Section 12.4: Cross product

Boelkins/Austin/Schlicker’s Active Multivariable Calculus
	Section 9.3: The dot product and Section 9.4: The cross product

Vector products

Question

If the world were fair, how would you compute ⟨a,b,c⟩⟨e,f,g⟩? :)

Other products

The dot product is a product between two vectors. The product is a scalar (a number), not a vector. This works for either 2D vectors or 3D vectors (and in even higher dimensions!).
	(Subscript[vector, 1])·(Subscript[vector, 2])=scalar

The cross product is also a product between two vectors. The product is a vector, but it only works for 3D vectors.
	(Subscript[vector, 1])×(Subscript[vector, 2])=vector

Dot product

Component definition

The dot product of (Overscript[u, ->])=⟨a,b,c⟩ and (Overscript[v, ->])=⟨d,e,f⟩ is
	(Overscript[u, ->])·(Overscript[v, ->])=⟨a,b,c⟩·⟨d,e,f⟩=a d+b e+c f

Questions

What is ⟨1,2,3⟩·⟨1,-2,1⟩?

What is ⟨1,4⟩·⟨5,-2⟩?

If (Overscript[u, ->])=⟨2,1,4⟩ what is (Overscript[u, ->])·(Overscript[u, ->])?

Geometric definition

The dot product of (Overscript[u, ->]) and (Overscript[v, ->]) is defined in terms of the angle between the two vectors, call it θ.
	(Overscript[u, ->])·(Overscript[v, ->])=|(Overscript[u, ->])| |(Overscript[v, ->])| cos(θ)

Questions

Let (Overscript[u, ->])=⟨2,0⟩ and (Overscript[v, ->])=⟨3,3⟩.

What is the angle between these two vectors?

Compute (Overscript[u, ->])·(Overscript[v, ->]) using the geometric definition.

Equivalence of definitions

p0={0,0};
p1={1,2};
p2={-3,3};
Graphics[{Arrow[{p0,p1}],Arrow[{p0,p1}],Dashing[{0.01}],Circle[p0,.3,{0,Pi/3}],Circle[p0,.6,{0,3Pi/4}],PointSize[0.02],Point[p1],Point[p1],Text[Style[u,FontSize->24,FontWeight->Bold],.6p1,{1,1}],Text[Style[v,FontSize->24,FontWeight->Bold],.6p1,{1,-1}],Text[α,.4{Cos[Pi/6],Sin[Pi/6]}],Text[β,.7{Cos[Pi/3+.2],Sin[Pi/3+.2]}],Text[{(Subscript[x, 0]),(Subscript[y, 0])},p1,{-1,-1}],Text[{(Subscript[x, 1]),(Subscript[y, 1])},p1,{-1,-1}]},Axes->True,BaseStyle->(FontSize->18),Ticks->None,PlotRange->{{-3.5,3.5},{0,3.5}}]

In the above
	α is the angle between the positive x-axis and vector (Overscript[v, ->])
	((Subscript[x, 0]),(Subscript[y, 0])) is the terminal point of vector (Overscript[v, ->])
	β is the angle between the positive x-axis and vector (Overscript[u, ->])
	((Subscript[x, 1]),(Subscript[y, 1])) is the terminal point of vector (Overscript[u, ->])

What is the angle between vectors (Overscript[u, ->]) and (Overscript[v, ->]) in terms of the angles α and β?

What are the polar coordinates of ((Subscript[x, 0]),(Subscript[y, 0])) and ((Subscript[x, 1]),(Subscript[y, 1])) in terms of the other variables in the plot?

What is the trigonometric identity on the cosine of the difference of two angles?

Main uses of dot product

We compute the dot product using the component formulation, while applications arise from the geometric formulation. Besides determining the angle between two given vectors:

What is the angle between a vector and itself? Use your answer to give geometric significance to (Overscript[u, ->])·(Overscript[u, ->]).

Given two vectors how can you use the dot product to determine if they are perpendicular to each other?

Questions

What is the angle between ⟨1,2,3⟩ and ⟨1,-2,1⟩?

Which of the following vectors are perpendicular to each other?

⟨1,-1,1⟩

⟨1,2,1⟩

⟨1,1,1⟩

⟨-3,0,3⟩

What choice(s) for k will make vector ⟨1,2,k⟩ perpendicular to vector ⟨2,1,-2⟩?

Projections

The idea of projections comes up in many different contexts.

Examples

In computer graphics depicting 3D objects on a 2D screen involves projecting.

In mechanics the result of a force might be constrained by how the object feeling the force is allowed to move. The force is projected into the allowable motion.

In data science a huge amount of data must be reduced to a more manageable amount of data. Typically, this involves projecting the structure of the more complicated data into a less complicated structure using some kind of projection.

These are all built from the idea of projecting one vector onto another.

Vector projection

Given two vectors (Overscript[u, ->]) and (Overscript[v, ->]) the projection of (Overscript[u, ->]) onto (Overscript[v, ->]) is a new vector that has the same (or opposite) direction as (Overscript[v, ->]) but whose length comes by finding the “perpendicular” shadow of (Overscript[u, ->]) on (Overscript[v, ->]).

Place the two vectors so they have the same initial point.

p0={0,0};
GraphicsRow[{Graphics[{Arrow[{p0,{2,1}}],Arrow[{{0,0},{0,2}}],Text[v,{1.2,.4}],Text[u,{-.2,1}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)],Graphics[{Arrow[{{0,0},{2,1}}],Arrow[{{0,0},{-3,1}}],Text[v,{1.2,.4}],Text[u,{-1.6,.3}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)]},Spacings->200,Dividers->Center]

Draw the line through the vector you are projecting onto, here vector (Overscript[v, ->]).

GraphicsRow[{Graphics[{Arrow[{{0,0},{2,1}}],Arrow[{{0,0},{0,2}}],Dashing[{0.01}],Line[{{3,1.5},{-3,-1.5}}],Text[v,{1.2,.4}],Text[u,{-.2,1}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)],Graphics[{Arrow[{{0,0},{2,1}}],Arrow[{{0,0},{-3,1}}],Dashing[{0.01}],Line[{{3,1.5},{-3,-1.5}}],Text[v,{1.2,.4}],Text[u,{-1.6,.3}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)]},Spacings->200,Dividers->Center]

Draw the line passing through the terminal point of vector (Overscript[u, ->]) that is perpendicular to the line through (Overscript[v, ->]). The projection is the vector whose initial point is the same as the original two vectors and whose terminal point is the intersection of the perpendicular line with the line through (Overscript[v, ->]).

GraphicsRow[{Graphics[{Arrow[{{0,0},{2,1}}],Arrow[{{0,0},{0,2}}],Dashing[{0.01}],Line[{{3,1.5},{-3,-1.5}}],Line[{{0,2},{.8,.4}}],Text[v,{1.2,.4}],Text[u,{-.2,1}],Dashing[{}],Blue,Thick,Arrow[{{0,0},{.8,.4}}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)],Graphics[{Arrow[{{0,0},{2,1}}],Arrow[{{0,0},{-3,1}}],Dashing[{0.01}],Line[{{3,1.5},{-3,-1.5}}],Line[{{-3,1},{-2,-1}}],Text[v,{1.2,.4}],Text[u,{-1.6,.3}],Dashing[{}],Blue,Thick,Arrow[{{0,0},{-2,-1}}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)]},Spacings->200,Dividers->Center]

GraphicsRow[{Graphics[{Arrow[{{0,0},{2,1}}],Arrow[{{0,0},{0,2}}],Dashing[{0.01}],Line[{{3,1.5},{-3,-1.5}}],Line[{{0,2},{2/Sqrt[5],1/Sqrt[5]}}],Text[v,{1.2,.4}],Text[u,{-.2,1}],Dashing[{}],Blue,Thick,Arrow[{{0,0},{2/Sqrt[5],1/Sqrt[5]}}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)],Graphics[{Arrow[{{0,0},{2,1}}],Arrow[{{0,0},{-3,1}}],Dashing[{0.01}],Line[{{3,1.5},{-3,-1.5}}],Line[{{-3,1},{-2,-1}}],Text[v,{1.2,.4}],Text[u,{-1.6,.3}],Dashing[{}],Blue,Thick,Arrow[{{0,0},{-2,-1}}]},PlotRange->{p1,{-1,2}},BaseStyle->(FontSize->18)]},Spacings->200,Dividers->Center]

Questions

If θ is the angle between (Overscript[u, ->]) and (Overscript[v, ->]), what is the length of the projected vector in terms of θ?

Scale vector (Overscript[v, ->]) by the appropriate amount to get the projected vector.

Definition

The projection of vector (Overscript[u, ->]) onto vector (Overscript[v, ->]) is the vector (Subscript[proj, (Overscript[v, ->])])(Overscript[u, ->])=((((Overscript[u, ->])·(Overscript[v, ->]))/((|(Overscript[v, ->])|)^2)))(Overscript[v, ->]).

Questions

Let (Overscript[u, ->])=⟨1,2,-2⟩ and (Overscript[v, ->])=⟨0,1,3⟩.

What is (Subscript[proj, (Overscript[v, ->])])(Overscript[u, ->])?

u={1,2,-2}
v={0,1,3}
unit[v_]:=v/Norm[v]
comp[u_,v_]:=Dot[u,unit[v]]
proj[u_,v_]:=comp[u,v]unit[v]
perp[u_,v_]:=u-proj[u,v]
uproj=proj[u,v]
uperp=perp[u,v]
uproj+uperp

What is (Subscript[proj, (Overscript[u, ->])])(Overscript[v, ->])?

vproj=proj[v,u]
vperp=perp[v,u]
vproj+vperp

Work

If a constant force vector (Overscript[F, ->]) is exerted in a straight line from point P to point Q, the work done by the force is
	W=(Overscript[F, ->])·(Overscript[P Q, ->])
Remember to turn angles into radian measure (multiply degrees by Pi/180 to turn them into radians).

Question

A wagon is pulled a distance of 100 meters along a horizontal path by a constant force of 70 Newtons. The handle of the wagon is held at an angle of 35° above the horizontal. What is the work done by that force?

force={70.0 Cos[35*Pi/180],70.0Sin[35*Pi/180]}
forceproj=proj[force,{1,0}]
forceperp=perp[force,{1,0}]
forceproj+forceperp
forceproj[[1]]*100 (* Newton-meters == Joules *)

Graphics

Vectors and polar coordinates are useful tools in creating computer graphics.

We want to design a clock, using vector “hands” that tick off the minutes (big hand) and hours (little hand). What equations would you use for the vector hands? Measure time in minutes, and all hands start at the top of the clock (along the y-axis) at midnight.

hour[t_]:={Sin[t/60*2Pi/12],Cos[t/60*2Pi/12]};
minutes[t_]:=2{Sin[t*2Pi/60],Cos[t*2Pi/60]};
Manipulate[
Show[
PolarPlot[2,{th,0,2Pi},AspectRatio->1.3],
Graphics[
{
Blue,Arrow[{{0,0},minutes[t]}],
Green,Arrow[{{0,0},hour[t]}]
}
],AspectRatio->Automatic
],
{{t,0},0,60*12,1}
]

When will the hour and minute hands be pointing in the same direction?

hour[t_]:={Sin[t/60*2Pi/12],Cos[t/60*2Pi/12]};
minutes[t_]:=2{Sin[t*2Pi/60],Cos[t*2Pi/60]};
Simplify[Dot[hour[t],minutes[t]]]
2Cos[t*2Pi/60 - t/60*2Pi/12]
p1=Plot[Dot[hour[t],minutes[t]],{t,0,720}];
p2=Plot[2Cos[t*2Pi/60 - t/60*2Pi/12],{t,0,60},PlotStyle->Red];
Show[p1,p2]
solns=Solve[11t/60*2Pi/12==2n Pi,t,Reals]
tee =t/.solns[[1]]
Table[{tee  1.0 },{n,0,11}] (* time in minutes to overlap *)
Table[{tee - 60.0Floor[tee/60] },{n,0,11}] (* time in minutes showing on the clock *)

The following works, too, but the answers are given somewhat cryptically: we simply create a dot product function “align”, and then solve for where it’s equal to the product of the lengths.

align[t_]:=Simplify[Dot[hour[t],minutes[t]]]
NSolve[align[t]==2,t,Reals]

Cross Products

Cross product definition

The dot product is a multiplication-like operation between two vectors (two 2D vectors or two 3D vectors -- and beyond!) that gives a scalar value.

The cross product is a multiplication-like operation between two 3D that gives a vector value. The cross product is only defined for 3D vectors.

Geometric definition

The cross product of 3D vectors (Overscript[u, ->]) and (Overscript[v, ->]) is denoted (Overscript[u, ->])×(Overscript[v, ->]).

The magnitude of (Overscript[u, ->])×(Overscript[v, ->])  is given by                                                                                                    |(Overscript[u, ->])×(Overscript[v, ->])|=|(Overscript[u, ->])| |(Overscript[v, ->])|sin(θ)                                                                where θ is the smaller of the two angles between vectors (Overscript[u, ->]) and (Overscript[v, ->]).

The direction of (Overscript[u, ->])×(Overscript[v, ->]) is perpendicular to both (Overscript[u, ->]) and (Overscript[v, ->]). There are two such directions. Choose the one that satisfies the right-hand rule.

Right-hand rule

To determine the direction of (Overscript[u, ->])×(Overscript[v, ->]) from the two possible directions, using the fingers on your right hand

Point your index finger in the direction of (Overscript[u, ->]).

Sweep that finger towards the direction of (Overscript[v, ->]). Your thumb will point in the correct direction of (Overscript[u, ->])×(Overscript[v, ->]).

(source)
Magnetic force is a cross product. Torque is a cross product. There are lots of cross products in physics!

Clear[u,v]
uu={2,-1,3};
vv={1,2,1};
ucrossv=Cross[uu,vv];
vcrossu=Cross[vv,uu];
mag=Sqrt[ucrossv.ucrossv];
Graphics3D[{Arrow[{{0,0,0},uu}],
Arrow[{{0,0,0},vv}],
Green,Arrow[{{0,0,0},vcrossu/mag}],
Text[Cross[v,u],1.1vcrossu/mag,{1,1}],
Blue,Arrow[{{0,0,0},ucrossv/mag}],
Text[Cross[u,v],1.1ucrossv/mag,{1,1}],
Text[u,1.1uu,{1,1}],
Text[v,1.1vv,{1,0}]
},BaseStyle->FontSize->18
]

Questions

Let (Overscript[i, ->])=⟨1,0,0⟩, (Overscript[j, ->])=⟨0,1,0⟩, and (Overscript[k, ->])=⟨0,0,1⟩. Use the above geometric definition to determine the following cross products.

Graphics3D[{Thick,Red,Arrow[{{0,0,0},{1,0,0}}],Text["(Overscript[i, ->])",{1.0,0.1,0.1}],Blue,Arrow[{{0,0,0},{0,1,0}}],Text["(Overscript[j, ->])",{.1,1.,.1}],Green,Arrow[{{0,0,0},{0,0,1}}],Text["(Overscript[k, ->])",{.1,.1,1}]},BaseStyle->{FontSlant->Italic,FontSize->18},Axes->True,AxesLabel->{x,y,z},PlotRange->{{0,1.5},{0,1.5},{0,1.5}}]

What is (Overscript[i, ->])×(Overscript[j, ->])?

Cross[{1,0,0},{0,1,0}]

What is (Overscript[i, ->])×(Overscript[k, ->])?

Cross[{1,0,0},{0,0,1}]

What is (Overscript[j, ->])×(Overscript[k, ->])?

Cross[{0,1,0},{0,0,1}]

Question

Are (Overscript[u, ->])×(Overscript[v, ->]) and (Overscript[v, ->])×(Overscript[u, ->]) the same?

Cross[{0,1,0},{0,0,1}]
Cross[{0,0,1},{0,1,0}]

Component definition

If (Overscript[u, ->])=⟨(Subscript[u, 1]),(Subscript[u, 2]),(Subscript[u, 3])⟩ and (Overscript[v, ->])=⟨(Subscript[v, 1]),(Subscript[v, 2]),(Subscript[v, 3])⟩, then
	(Overscript[u, ->])×(Overscript[v, ->])=⟨(Subscript[u, 2]) (Subscript[v, 3])-(Subscript[u, 3]) (Subscript[v, 2]),(Subscript[u, 3]) (Subscript[v, 1])-(Subscript[u, 1]) (Subscript[v, 3]),(Subscript[u, 1]) (Subscript[v, 2])-(Subscript[u, 2]) (Subscript[v, 1])⟩.

Cross[{(Subscript[u, 1]),(Subscript[u, 2]),(Subscript[u, 3])},{(Subscript[v, 1]),(Subscript[v, 2]),(Subscript[v, 3])}]

Notes:

The first component of the cross product consists of the second and third components of the given two vectors.

The second component of the cross product consists of the first and third components of the given two vectors.

The third component of the cross product consists of the first and second components of the given two vectors.

If we check the permutations of the indices, then 123, 231, and 312 give rise to positive contributions, while 321, 213, and 132 give rise to negative contributions.

Since I hate memorizing stuff like all that above, I just think in terms of components, and the three basis vectors of our Cartesian coordinate system:

(Overscript[u, ->])×(Overscript[v, ->])= ((Subscript[u, 1])(Overscript[i, ->])+(Subscript[u, 2])(Overscript[j, ->])+(Subscript[u, 3])(Overscript[k, ->]))×((Subscript[v, 1])(Overscript[i, ->])+(Subscript[v, 2])(Overscript[j, ->])+(Subscript[v, 3])(Overscript[k, ->]))?
	= ((Subscript[u, 2]) (Subscript[v, 3])-(Subscript[u, 3]) (Subscript[v, 2]))(Overscript[i, ->])+((Subscript[u, 3]) (Subscript[v, 1])-(Subscript[u, 1]) (Subscript[v, 3]))(Overscript[j, ->])+((Subscript[u, 1]) (Subscript[v, 2])-(Subscript[u, 2]) (Subscript[v, 1]))(Overscript[k, ->])

Questions

Let (Overscript[i, ->])=⟨1,0,0⟩,   (Overscript[j, ->])=⟨0,1,0⟩,   and (Overscript[k, ->])=⟨0,0,1⟩. Use the above component definition to determine the following cross products. (Compare with the results using the geometric definition.)

What is (Overscript[i, ->])×(Overscript[j, ->])?

What is (Overscript[i, ->])×(Overscript[k, ->])?

What is (Overscript[j, ->])×(Overscript[k, ->])?

Question

What is a vector that is perpendicular to both (Overscript[u, ->])=⟨2,-1,3⟩ and (Overscript[v, ->])=⟨1,2,1⟩?

Cross[{2,-1,3},{1,2,1}]

Cross product geometric properties

The magnitude of (Overscript[u, ->])×(Overscript[v, ->])  is given by
               |(Overscript[u, ->])×(Overscript[v, ->])|=|(Overscript[u, ->])| |(Overscript[v, ->])|sin(θ)
 where θ is the smaller of the two angles between vectors (Overscript[u, ->]) and (Overscript[v, ->]).

If (Overscript[u, ->])×(Overscript[v, ->])=(Overscript[0, ->]), then its magnitude is 0. One of three things must be true.

(Overscript[u, ->])=(Overscript[0, ->]), or

(Overscript[v, ->])=(Overscript[0, ->]), or

sin(θ)=0 which means θ=0. The vectors must be parallel, pointing in the same direction or in the exact opposite direction.

Place vectors (Overscript[u, ->]) and (Overscript[v, ->]) so their initial points are the same. They form two of the sides of a parallelogram. The area of a parallelogram is height×base.

Graphics[{Line[{{0,0},{2,0},{2.5,1},{0.5,1},{0,0}}],Dashed,Arrow[{{0.8,-0.1},{0,-0.1}}],Arrow[{{1.2,-0.1},{2,-0.1}}],Text["Base",{1,-0.1}],Arrow[{{0.5,0.4},{0.5,0}}],Arrow[{{0.5,0.6},{0.5,1}}],Text["Height",{0.5,0.5}]}]

The area of this parallelogram is

|(Overscript[u, ->])| |(Overscript[v, ->])|sin(θ)=|(Overscript[u, ->])×(Overscript[v, ->])|

(in terms of the lengths of these vectors and the angle θ between them).

Clear[u,v];null={0,0,0};uu={2,-1,3};vv={1,2,1};uuUnit=uu/Sqrt[uu.uu];vvUnit=vv/Sqrt[vv.vv];
arc=ParametricPlot3D[.5(Sin[t] vvUnit+Cos[t] uuUnit),{t,0,Pi/2}];
Show[Graphics3D[{Arrow[{null,uu}],Arrow[{null,vv}],Dashing[{0.02}],Line[{uu,uu+vv,vv}],Text[Style[u,FontSize->18],.5uu,{1,1}],Text[Style[v,FontSize->18],.5vv,{1,0}],Text[Style[θ,FontSize->18],.5(uuUnit+vvUnit)]}],arc]

Questions

What is the area of the parallelogram formed from vectors (Overscript[u, ->])=⟨2,-1,3⟩ and (Overscript[v, ->])=⟨1,2,1⟩?

w=Cross[{2,-1,3},{1,2,1}]
Norm[w]
Sqrt[w.w]

What is the area of the triangle with vertices (0,1,0), (2,-1,-1), (-1,0,1)?

(* define two vectors, making two legs of the triangle: *)
uu={2,-1,-1}-{0,1,0}
vv={-1,0,1}-{0,1,0}
(* A triangle is half of a parallelogram! *)
1/2*Norm[Cross[uu,vv]]

Cross product algebraic properties

Question

How are (Overscript[a, ->])×(Overscript[b, ->]) and (Overscript[b, ->])×(Overscript[a, ->]) related? (The cross-product is non-commutative!)

Other properties

(s (Overscript[a, ->]))×(Overscript[b, ->])=s((Overscript[a, ->])×(Overscript[b, ->]))=(Overscript[a, ->])×(s (Overscript[b, ->]))      (where s is a scalar)

(Overscript[a, -> ])×((Overscript[b, ->])+(Overscript[c, ->]))=(Overscript[a, ->])×(Overscript[b, ->])+(Overscript[a, ->])×(Overscript[c, ->])

(Overscript[a, ->])·((Overscript[b, ->])×(Overscript[c, ->]))=((Overscript[a, ->])×(Overscript[b, ->]))·(Overscript[c, ->])

Questions

Show property 2 is true by computing each side using
	(Overscript[a, ->])=⟨(Subscript[a, 1]),(Subscript[a, 2]),(Subscript[a, 3])⟩, (Overscript[ b, ->])=⟨(Subscript[b, 1]),(Subscript[b, 2]),(Subscript[b, 3])⟩,  (Overscript[c, ->])=⟨(Subscript[c, 1]),(Subscript[c, 2]),(Subscript[c, 3])⟩

Show that the cross-product is non-associative: that is, in general 
	(Overscript[a, -> ])×((Overscript[b, ->])×(Overscript[c, ->]))≠((Overscript[a, ->])×(Overscript[b, ->]))×(Overscript[c, ->]).

What is (Overscript[k, ->])×((Overscript[i, ->])+2(Overscript[j, ->]))?

Cross[{0,0,1},{1,2,0}]

What is  (Overscript[a, ->])×(Overscript[b, ->])= ((Subscript[a, 1])(Overscript[i, ->])+(Subscript[a, 2])(Overscript[j, ->])+(Subscript[a, 3])(Overscript[k, ->]))×((Subscript[b, 1])(Overscript[i, ->])+(Subscript[b, 2])(Overscript[j, ->])+(Subscript[b, 3])(Overscript[k, ->]))?

Clear[a,b,c,d,e,f]
Cross[{a,b,c},{d,e,f}]