Here's a question whose answer turns out to be very useful: Given two vectors, what is the angle between them?
It may not be immediately clear that the question makes sense, but it's not hard to turn it into a question that does. Since vectors have no position, we are as usual free to place vectors wherever we like. If the two vectors are placed tail-to-tail, there is now a reasonable interpretation of the question: we seek the measure of the smallest angle between the two vectors, in the plane in which they lie. Figure 14.3.1 illustrates the situation.
Since the angle θ lies in a triangle, we can compute it using a bit of trigonometry, namely, the law of cosines. The lengths of the sides of the triangle in figure 14.3.1 are |A|, |B|, and |A−B|. Let A=⟨a1,a2,a3⟩ and B=⟨b1,b2,b3⟩; then |A−B|2=|A|2+|B|2−2|A||B|cosθ2|A||B|cosθ=|A|2+|B|2−|A−B|2=a21+a22+a23+b21+b22+b23−(a1−b1)2−(a2−b2)2−(a3−b3)2=a21+a22+a23+b21+b22+b23−(a21−2a1b1+b21)−(a22−2a2b2+b22)−(a23−2a3b3+b23)=2a1b1+2a2b2+2a3b3|A||B|cosθ=a1b1+a2b2+a3b3cosθ=(a1b1+a2b2+a3b3)/(|A||B|)
The numerator of the fraction that gives us cosθ turns up a lot, so we give it a name and more compact notation: we call it the dot product, and write it as A⋅B=a1b1+a2b2+a3b3.
Example 14.3.1 Find the angle between the vectors A=⟨1,2,1⟩ and B=⟨3,1,−5⟩. We know that cosθ=A⋅B/(|A||B|)=(1⋅3+2⋅1+1⋅(−5))/(|A||B|)=0, so θ=π/2, that is, the vectors are perpendicular. ◻
Example 14.3.2 Find the angle between the vectors A=⟨3,3,0⟩ and B=⟨1,0,0⟩. We compute cosθ=(3⋅1+3⋅0+0⋅0)/(√9+9+0√1+0+0)=3/√18=1/√2
Example 14.3.3 Some special cases are worth looking at: Find the angles between A and A; A and −A; A and 0=⟨0,0,0⟩.
cosθ=A⋅A/(|A||A|)=(a21+a22+a23)/(√a21+a22+a23√a21+a22+a23)=1, so the angle between A and itself is zero, which of course is correct.
cosθ=A⋅−A/(|A||−A|)=(−a21−a22−a23)/(√a21+a22+a23√a21+a22+a23)=−1, so the angle is π, that is, the vectors point in opposite directions, as of course we already knew.
cosθ=A⋅0/(|A||0|)=(0+0+0)/(√a21+a22+a23√02+02+02), which is undefined. On the other hand, note that since A⋅0=0 it looks at first as if cosθ will be zero, which as we have seen means that vectors are perpendicular; only when we notice that the denominator is also zero do we run into trouble. One way to "fix'' this is to adopt the convention that the zero vector 0 is perpendicular to all vectors; then we can say in general that if A⋅B=0, A and B are perpendicular. ◻
Generalizing the examples, note the following useful facts:
1. If A is parallel or anti-parallel to B then A⋅B/(|A||B|)=±1, and conversely, if A⋅B/(|A||B|)=1, A and B are parallel, while if A⋅B/(|A||B|)=−1, A and B are anti-parallel. (Vectors are parallel if they point in the same direction, anti-parallel if they point in opposite directions.)
2. If A is perpendicular to B then A⋅B/(|A||B|)=0, and conversely if A⋅B/(|A||B|)=0 then A and B are perpendicular.
Given two vectors, it is often useful to find the projection of one vector onto the other, because this turns out to have important meaning in many circumstances. More precisely, given A and B, we seek a vector parallel to B but with length determined by A in a natural way, as shown in figure 14.3.2. V is chosen so that the triangle formed by A, V, and A−V is a right triangle.
Using a little trigonometry, we see that |V|=|A|cosθ=|A|A⋅B|A||B|=A⋅B|B|;
The discussion so far implicitly assumed that 0≤θ≤π/2. If π/2<θ≤π, the picture is like figure 14.3.3. In this case A⋅B is negative, so the vector A⋅B|B|2B
Note that the phrase "projection onto B'' is a bit misleading if taken literally; all that B provides is a direction; the length of B has no impact on the final vector. In figure 14.3.4, for example, B is shorter than the projection vector, but this is perfectly acceptable.
Example 14.3.4 Physical force is a vector quantity. It is often necessary to compute the "component'' of a force acting in a different direction than the force is being applied. For example, suppose a ten pound weight is resting on an inclined plane—a pitched roof, for example. Gravity exerts a force of ten pounds on the object, directed straight down. It is useful to think of the component of this force directed down and parallel to the roof, and the component down and directly into the roof. These forces are the projections of the force vector onto vectors parallel and perpendicular to the roof. Suppose the roof is tilted at a 30∘ angle, as in figure 14.3.5. A vector parallel to the roof is ⟨−√3,−1⟩, and a vector perpendicular to the roof is ⟨1,−√3⟩. The force vector is F=⟨0,−10⟩. The component of the force directed down the roof is then F1=F⋅⟨−√3,−1⟩|⟨−√3,−1⟩|2⟨−√3,−1⟩=102⟨−√3,−1⟩2=⟨−5√3/2,−5/2⟩
The dot product has some familiar-looking properties that will be useful later, so we list them here. These may be proved by writing the vectors in coordinate form and then performing the indicated calculations; subsequently it can be easier to use the properties instead of calculating with coordinates.
Theorem 14.3.5 If u, v, and w are vectors and a is a real number, then
1. u⋅u=|u|2
2. u⋅v=v⋅u
3. u⋅(v+w)=u⋅v+u⋅w
4. (au)⋅v=a(u⋅v)=u⋅(av)
Exercises 14.3
You can use Sage to compute dot products and related quantities like the scalar and vector projections.
xxxxxxxxxx
v=vector([1,2,3])
w=vector([4,5,6])
dotp=v.dot_product(w)
scalar_proj=dotp/w.norm()
vector_proj=scalar_proj*w/w.norm()
show(dotp); show(scalar_proj); show(vector_proj)
Ex 14.3.1 Find ⟨1,1,1⟩⋅⟨2,−3,4⟩. (answer)
Ex 14.3.2 Find ⟨1,2,0⟩⋅⟨0,0,57⟩. (answer)
Ex 14.3.3 Find ⟨3,2,1⟩⋅⟨0,1,0⟩. (answer)
Ex 14.3.4 Find ⟨−1,−2,5⟩⋅⟨1,0,−1⟩. (answer)
Ex 14.3.5 Find ⟨3,4,6⟩⋅⟨2,3,4⟩. (answer)
Ex 14.3.6 Find the cosine of the angle between ⟨1,2,3⟩ and ⟨1,1,1⟩; use a calculator if necessary to find the angle. (answer)
Ex 14.3.7 Find the cosine of the angle between ⟨−1,−2,−3⟩ and ⟨5,0,2⟩; use a calculator if necessary to find the angle. (answer)
Ex 14.3.8 Find the cosine of the angle between ⟨47,100,0⟩ and ⟨0,0,5⟩; use a calculator if necessary to find the angle. (answer)
Ex 14.3.9 Find the cosine of the angle between ⟨1,0,1⟩ and ⟨0,1,1⟩; use a calculator if necessary to find the angle. (answer)
Ex 14.3.10 Find the cosine of the angle between ⟨2,0,0⟩ and ⟨−1,1,−1⟩; use a calculator if necessary to find the angle. (answer)
Ex 14.3.11 Find the angle between the diagonal of a cube and one of the edges adjacent to the diagonal. (answer)
Ex 14.3.12 Find the scalar and vector projections of ⟨1,2,3⟩ onto ⟨1,2,0⟩. (answer)
Ex 14.3.13 Find the scalar and vector projections of ⟨1,1,1⟩ onto ⟨3,2,1⟩. (answer)
Ex 14.3.14 A 20 pound object sits on a ramp at an angle of 30∘ from the horizontal, as in figure 14.3.5. Find the force pulling the object down the ramp and the force pulling the object directly into the ramp. (answer)
Ex 14.3.15 A 20 pound object sits on a ramp at an angle of 45∘ from the horizontal. Find the force pulling the object down the ramp and the force pulling the object directly into the ramp. (answer)
Ex 14.3.16 A force of 10 pounds is applied to a wagon, directed at an angle of 30∘ from the horizontal, as shown. Find the component of this force pulling the wagon straight up, and the component pulling it horizontally along the ground. (answer)
Ex 14.3.17 A force of 15 pounds is applied to a wagon, directed at an angle of 45∘ from the horizontal. Find the component of this force pulling the wagon straight up, and the component pulling it horizontally along the ground. (answer)
Ex 14.3.18 A force F is to be applied to a wagon, directed at an angle of 30∘ from the horizontal. The resulting force pulling the wagon horizontally along the ground is to be 10 pounds. What is the magnitude of the required force F? (answer)
Ex 14.3.19 Use the dot product to find a non-zero vector w perpendicular to both u=⟨1,2,−3⟩ and v=⟨2,0,1⟩. (answer)
Ex 14.3.20 Let x=⟨1,1,0⟩ and y=⟨2,4,2⟩. Find a unit vector that is perpendicular to both x and y. (answer)
Ex 14.3.21 Do the three points (1,2,0), (−2,1,1), and (0,3,−1) form a right triangle? (answer)
Ex 14.3.22 Do the three points (1,1,1), (2,3,2), and (5,0,−1) form a right triangle? (answer)
Ex 14.3.23 Show that |A⋅B|≤|A||B|
Ex 14.3.24 Let x and y be perpendicular vectors. Use Theorem 14.3.5 to prove that |x|2+|y|2=|x+y|2. What is this result better known as?
Ex 14.3.25 Prove that the diagonals of a rhombus intersect at right angles.
Ex 14.3.26 Suppose that z=|x|y+|y|x where x, y, and z are all nonzero vectors. Prove that z bisects the angle between x and y.
Ex 14.3.27 Prove Theorem 14.3.5.