topic badge

11.04 Dot product and the angle between two vectors

Lesson

Dot product and the angle between vectors

We have seen how the dot- or scalar product arises from the idea of angle in a vector space.

It was found that if $\mathbf{a}=(a_1,a_2)$a=(a1,a2) and $\mathbf{b}=(b_1,b_2)$b=(b1,b2) are non-zero vectors in the plane, then the angle $\theta$θ between them is given by

$\cos\theta=\frac{a_1b_1+a_2b_2}{\mathbf{|a|}\mathbf{|b|}}$cosθ=a1b1+a2b2|a||b|

and the quantity $a_1b_1+a_2b_2$a1b1+a2b2 is called the dot product of vectors $\mathbf{a}$a and $\mathbf{b}$b. We notate this for convenience as $\mathbf{a.b}$a.b so that the formula for $\cos\theta$cosθ above becomes

$\cos\theta=\frac{\mathbf{a.b}}{\mathbf{|a|}\mathbf{|b|}}$cosθ=a.b|a||b|

 

We can rearrange the above formula to give another way of defining the dot product. We have

$\mathbf{a.b}=\mathbf{|a|}\mathbf{|b|}\cos\theta$a.b=|a||b|cosθ

It is clear from this that if the two vectors are non-zero, the only way $\mathbf{a.b}$a.b can be zero is if $\cos\theta=0$cosθ=0, making $\theta$θ a right-angle.

Thus, we have a test for whether the angle between two vectors is a right-angle.

We say two vectors are orthogonal if their dot product is zero. The word orthogonal means at right-angles if we are thinking of two- or three-dimensional spaces but the idea extends to spaces of many dimensions and then the more general term becomes useful.

 

The dot product is also called the scalar product in recognition of the fact that it is an operation on two vector quantities that produces a scalar.

In general, if $\mathbf{u}$u and $\mathbf{v}$v are two vectors in a space of $n$n dimensions, their scalar product $\mathbf{u.v}$u.v defined by the coordinates is given by $u_1v_1+u_2v_2+...+u_nv_n$u1v1+u2v2+...+unvn.

 

There is a connection between the length of a vector and the scalar product. We note that $\mathbf{|a|}=\sqrt{a_1^2+a_2^2+a_3^2}=\sqrt{\mathbf{a.a}}$|a|=a21+a22+a23=a.a. That is, the dot product of a vector with itself is the squared length of the vector.

 

Notation

So far, we have used bold type to indicate that a quantity is a vector. This convention is used by many writers. It is also possible to use non-bold type for vectors when it is clear that a vector is intended. This convention is used in the exercises.

 

Properties

There are some algebraic properties of the scalar product that are useful. These are listed below without proof. We invite you to verify the properties yourself by writing the vectors in coordinate notation and carrying out the operations in this form.

  1. Commutative property:    $\mathbf{a.b}=\mathbf{b.a}$a.b=b.a
  2. Distributive property:     $\mathbf{(a+b).c}=\mathbf{a.c}+\mathbf{b.c}$(a+b).c=a.c+b.c
  3. Scalar multiplication:  $k(\mathbf{a.b})=(k\mathbf{a).b}$k(a.b)=(ka).b

In view of the connection with the magnitude of a vector (mentioned above) you could also explain why $\mathbf{a.a}\ge0$a.a0 for any vector $\mathbf{a}$a.

Worked examples

Question 1

Check whether the vectors $\mathbf{a}=2\mathbf{i}+3\mathbf{j}$a=2i+3j and $\mathbf{b}=-6\mathbf{i}+4\mathbf{j}$b=6i+4j are orthoganal.

The representation of the vectors in coordinate form with respect to the $\mathbf{i,j}$i,j basis is $\mathbf{a}=(2,3)$a=(2,3) and $\mathbf{b}=(-6,4)$b=(6,4). We calculate $\mathbf{a.b}=2\times(-6)+3\times4=0$a.b=2×(6)+3×4=0 and conclude that the angle between the vectors is a right-angle.

Question 2

A vector $\mathbf{v}$v has coordinates $(4,5)$(4,5). Find a vector perpendicular to this one with the same length.

By inspection, we see that either $\mathbf{u}=(-5,4)$u=(5,4) or $\mathbf{w}=(5,-4)$w=(5,4) would meet the requirements since $\mathbf{v.u}=\mathbf{v.w}=0$v.u=v.w=0 and all three vectors have length $\sqrt{41}$41.

Question 3

If $\mathbf{|u|}=5$|u|=5 and $\mathbf{|v|}=13$|v|=13 and the scalar product of the two vectors is $\mathbf{u.v}=25$u.v=25, what is the angle between them?

We use the fact that $\mathbf{u.v}=\mathbf{|u|}\mathbf{|v|}\cos\theta$u.v=|u||v|cosθ where $\theta$θ is the angle we seek. Thus, $25=5\times13\cos\theta$25=5×13cosθ. Therefore, $\cos\theta=\frac{25}{65}$cosθ=2565 and so, $\theta=\arccos\frac{25}{65}\approx67^\circ$θ=arccos256567°.

Practice questions

Question 4

Are the vectors $\left(3,2\right)$(3,2) and $\left(-5,4\right)$(5,4) perpendicular?

  1. Yes

    A

    No

    B

Question 5

Elizabeth is collecting snow samples in a collection box for a science project. Let $P=i-3j$P=i3j represent the amount of snowfall in centimeters and the direction in which it falls. Let $Q=3i+4j$Q=3i+4j represent the area in square centimeters and orientation of the opening of the collection box. The total volume of snow collected in the tank is given by $V$V$=$=$|$|$P$P$\cdot$·$Q$Q$|$|.

  1. Calculate $\left|P\right|$|P|, correct to the nearest tenth.

  2. Calculate $\left|Q\right|$|Q|.

  3. Calculate $V$V.

  4. Consider your answers to parts (a), (b) and (c) to help you complete the following statements:

    $\editable{}$cm of snow fell.

    The area of the opening of the collection box is $\editable{}$cm².

    $\editable{}$cm³ of snow were collected.

  5. Elizabeth decides to change the orientation of the collection box to maximize the amount of snow collected. What should be true about vectors $P$P and $Q$Q?

    $P$P and $Q$Q should be parallel and point in opposite directions.

    A

    $P$P and $Q$Q should be perpendicular.

    B

    $P$P and $Q$Q should be parallel and point in the same direction.

    C

Question 6

Find the dot product of $\vec{u}$u$=$=$\left(6,5\right)$(6,5) and $\vec{v}$v$=$=$\left(7,-2\right)$(7,2).

Applications of dot product

Many applications in the theory of vectors come from the field of physics. For example, when a force acts on a body having a certain mass and moves it through a distance, the work done is said to be the product of the displacement and the magnitude of the force in the direction of the displacement.

We might have a heavy object being dragged across a rough surface where the pulling force is applied at an angle, as in the following diagram.

If the object moves a distance $s$s across the surface, the work done is $s|\vec{F}|\cos\theta$s|F|cosθ. We resolved the vector $\vec{F}$F into two orthogonal components so that one component would be acting in the direction of the displacement.

The component vector shown in red in the diagram can be thought of as the orthogonal projection of $\vec{F}$F in the direction of the displacement. It is like the shadow of the line representing $\vec{F}$F formed by a light directly above.

We can find this projection if we know the coordinate form of vector $\vec{F}$F, without reference to the angle $\theta$θ. To do this, we need the scalar product which has been introduced earlier.

Orthogonal projections

Suppose $\vec{u}$u and $\vec{v}$v are vectors pointing in different directions. (More generally, we would say the vectors are linearly independent.)

There must be a scalar $k$k such that $\vec{u}-k\vec{v}$ukv is perpendicular to $\vec{v}$v. Refer to the diagram below to see this.

In the diagram, $k\vec{v}$kv is the orthogonal projection of $\vec{u}$u on $\vec{v}$v.

Since $\vec{u}-k\vec{v}$ukv is orthogonal to $\vec{v}$v, we have the scalar product $(\vec{u}-k\vec{v})\cdot\vec{v}=0$(ukv)·v=0.  And so, $\vec{u}\cdot\vec{v}-k\vec{v}\cdot\vec{v}=0$u·vkv·v=0.

We conclude that $k=\frac{\vec{u}\cdot\vec{v}}{\vec{v}\cdot\vec{v}}=\frac{\vec{u}\cdot\vec{v}}{|\vec{v}|^2}$k=u·vv·v=u·v|v|2

Thus, if we use the notation $P_v(\vec{u})$Pv(u) to mean the orthogonal projection of $\vec{u}$u onto $\vec{v}$v, we can write

$P_v(\vec{u})=\frac{\vec{u}\cdot\vec{v}}{|\vec{v}|^2}\vec{v}$Pv(u)=u·v|v|2v

 

Worked examples

Question 7

A force represented by the vector $6\mathbf{i}+10\mathbf{j}$6i+10j moves an object by a displacement represented by $3\mathbf{i}+4\mathbf{j}$3i+4j. What work is done?

Conventionally, the magnitude of the force is measured in Newtons and the displacement is in meters so that the work has the unit Newton meter or Nm, also called a Joule.

The work done will be the magnitude of the projection of the force vector onto the displacement vector, multiplied by the amount of the displacement. 

$W$W $=$= $\left|\frac{(6,10)\cdot((3,4)}{(3,4)\cdot(3,4)}(3,4)\right|\times\sqrt{3^2+4^2}$|(6,10)·((3,4)(3,4)·(3,4)(3,4)|×32+42
  $=$= $\frac{58}{25}\left|(3,4)\right|\times\sqrt{25}$5825|(3,4)|×25
  $=$= $\frac{58}{25}\sqrt{25}\times\sqrt{25}$582525×25
  $=$= $58\ Nm$58 Nm

That is, the work is just the scalar product of the force and displacement vectors. You could check algebraically that this relation holds in all cases: $W=\vec{F}\cdot\vec{s}$W=F·s.

This can also be seen in the original diagram, where the work done in dragging the object through a distance $s$s would be $W=|\vec{s}||\vec{F}|\cos\theta$W=|s||F|cosθ and this is just $\vec{s}\mathbf{\cdot}\vec{F}$s·F.

It follows that other calculations of a similar kind can be carried out more simply than was done in the example.

Question 8

We wish to resolve the vector $4\mathbf{i}-\mathbf{j}$4ij into two orthogonal components, one of which is parallel to $\mathbf{i}+\mathbf{j}$i+j. What are the two components?

We need the projection of $(4,-1)$(4,1) onto $(1,1)$(1,1) for one of the components.

This is $\frac{4-1}{1+1}(1,1)=\left(\frac{3}{2},\frac{3}{2}\right)$411+1(1,1)=(32,32). We want the sum of this component and a vector $\mathbf{v}$v orthogonal to it, to be the original vector $(4,-1)$(4,1).

So, $\mathbf{v}=(4,-1)-\left(\frac{3}{2},\frac{3}{2}\right)=\left(\frac{5}{2},\frac{-5}{2}\right)$v=(4,1)(32,32)=(52,52).

Thus, the components are $\frac{3}{2}\mathbf{i}+\frac{3}{2}\mathbf{j}$32i+32j and $\frac{5}{2}\mathbf{i}-\frac{5}{2}\mathbf{j}$52i52j. You should identify the vectors in this exercise in the following diagram as a check.

 

Practice questions

Question 9

Calculate the work done in pushing a table $2.8$2.8 m across the room against a frictional force of $190$190 N.

Question 10

Calculate the work done by gravity in causing a $11$11 kg tree branch to slide $45$45 m down a hill that is at an angle of $43^\circ$43° to the horizontal.

Assume the acceleration due to gravity is $9.8$9.8 m/s2. Give your answer to the nearest joule.

Question 11

Tom wants to push a $60$60 kg boulder up a ramp that is inclined at an angle of $17^\circ$17° to the horizontal. If he is to push the boulder at an angle of $36^\circ$36° to the horizontal, what is the minimum force that he must exert?

Give your answer to the nearest tenth of a Newton.

What is Mathspace

About Mathspace