Skip to main content

Section 2.7 Dot Products

There are two distinct ways to multiply vectors together. The first, which will be discussed here, is called the dot product or scalar product,because the result is a scalar value. The second, called the cross product, will be discussed in Section 2.8 below.

Dot products are used to compute the angle between vectors and to determine the project of one vector onto another. The projection represents the portion of the first vector which is parallel to second vector.

The dot product of two vectors \(\vec{A}\) and \(\vec{B}\) is defined as the sum of the product of the vector components in each coordinate direction. For three-dimensional vectors \(\vec{A}\) and \(\vec{B}\text{,}\)

\begin{gather*} \vec{A} = \langle A_x, A_y, A_z \rangle\\ \vec{B} = \langle B_x, B_y, B_z \rangle \end{gather*}
\begin{equation} \vec{A} \cdot \vec{B} = A_x B_x + A_y B_y + A_z B_z \text{.}\label{dot-product-1}\tag{2.7.1} \end{equation}

For two-dimensional vectors, the \(z\) components and the \(A_z B_z\) term of the dot product are zero.

Dot products are commutative, associative and distributive:

  1. Commutative. The order does not matter

    \begin{equation} \vec{A}\cdot\vec{B} = \vec{B}\cdot\vec{A}\tag{2.7.2} \end{equation}
  2. Associative. It does not matter whether you multiply a scalar value a by the final dot product, or either of the individual vectors, you will still get the same answer.
    \begin{equation} a\left( \vec{A}\cdot\vec{B} \right ) = a\vec{A}\cdot\vec{B}= \vec{A}\cdot a\vec{B}\tag{2.7.3} \end{equation}
  3. Distributive. If you are dotting one vector \(\vec{A}\) with the sum of two more \((\vec{B}+\vec{C})\text{,}\) you can either add \(\vec{B}+\vec{C}\) first, or dot \(\vec{A}\) by both and add the final value.
    \begin{equation} \vec{A}\cdot\left( \vec{B} + \vec{C} \right ) = \vec{A}\cdot\vec{B}+ \vec{A}\cdot \vec{C}\tag{2.7.4} \end{equation}

Subsection 2.7.1 Dot Products and Magnitude

Dot products can be used to find vector magnitudes. When a vector is dotted with itself, the result is the square of the magnitude of the vector. Consider the two dimensional vector \(\vec{A} = \langle A_x, A_y \rangle\text{.}\) Applying equation (2.7.1), and recognizing the form of the the Pythagorean Theorem, we see

\begin{align*} \vec{A} \cdot \vec{A} \amp = A_x A_x + A_y A_y \\ \amp = A_x^2 + A_y^2 \\ \sqrt{\vec{A} \cdot \vec{A}} \amp = \sqrt{A_x^2 + A_y^2} = A\\ | \vec{A} | \amp = \sqrt{\vec{A} \cdot \vec{A}}. \end{align*}
Example 2.7.1. Find vector magnitude using dot product.

Find the magnitude of vector \(\vec{F}\) with components \(F_x = \N{30}\) and \(F_y=\N{-40}\)

Answer
\begin{equation*} F = |\vec{F}| = \N{50} \end{equation*}
Solution
\begin{align*} F^2 \amp = \vec{F} \cdot \vec{F}\\ \amp = F_x^2 + F_y^2\\ \amp = (\N{30})^2 +(\N{-40})^2\\ \amp = \N{250}\\\\ F \amp= \sqrt{\N{250}}\\ F = |\vec{F}| = \N{50} \end{align*}

Subsection 2.7.2 Angle between two vectors

An alternate, equivalent method to find the dot product of two vectors is

\begin{align*} \vec{A} \cdot \vec{B}\amp = | \vec{A} | | \vec{B} |\cos \theta \\ \amp = (A) (B) \cos \theta \end{align*}

In this equation \(\theta\) in the equation is the angle between between the two vectors.

Subsubsection Computation of a Dot Product Using Vector Components

The dot product is used to find the projection of one vector onto another or the angle between two vectors. Let us go back to our example of the two cables in the interactive in Figure 2.6.1. If you would like to compute the portion of of tension in cable \(A\) which is pulling in the same direction as cable \(B\text{,}\) known as the projection of \(\vec{A}\) onto \(\vec{B}\) you could start with the dot product.

Figure 2.7.1. Vector Dot Product

Coming back to our basic dot product equation, we can compute the dot products of unit vectors \(\ihat\) and \(\jhat\text{.}\) The dot product of \(\ihat\) and \(\ihat\) is:

\begin{equation*} \ihat \cdot \ihat = (1) (1)\cos \ang{0} = 1 \end{equation*}

As the length of \(\ihat\) is just 1, equation result is dependent on the \(\cos \theta\text{.}\) Of course, in this case \(\theta = \ang{0}\) and we know that the \(\cos \ang{0} = 1 \text{.}\)

Similarly, the orthogonal unit vectors \(\ihat\) and \(\jhat\) are \(\ang{90}\) apart so,

\begin{equation*} \ihat \cdot \jhat = (1) (1)\cos \ang{90} = 0 \end{equation*}

Hence, the dot product of parallel vectors is the product of their lengths, and the dot product of perpendicular vectors is zero. Thus, we can also write that a dot product is equal to the sum-product of the like components:

\begin{equation} \vec{A} \cdot \vec{B} =A_x B_x + A_y B_y = (A )( B)\cos \theta\tag{2.7.5} \end{equation}

Subsection 2.7.3 Vector Projection

Now, let's look geometrically at the vector projections, by which we mean the rectangular component of one vector in the direction specified by another vector. In the interactive of Figure 2.7.1, the projection of the blue vector \(\vec{B}\) in the direction of the red vector \(\vec{A}\) is the black vector \(\vec{u}\text{.}\) If the vectors represent forces, the projection is also a force.

Interactive showing how a drawing a line perpendicular to \(\vec{B}\) to the tip of \(\vec{A}\) creates a right triangle with the interior angle \(\theta\text{.}\) You can change both vectors by dragging the orange ‘+’ marks.

Our goal is to find the amount of tension force \(\vec{A}\) which is parallel to tension force \(\vec{B}\text{.}\) We see that the adjacent side of our new right triangle can be shown to be equal to \(A \cos \theta\text{.}\) This appears to be the answer to our question, but how is it this value related to the dot product? It turns out that the dot product gives us a bit more than just \(A \cos \theta\text{.}\) Rearranging the right side of the basic dot product equation we can see that

\begin{equation} \vec{A}\cdot \vec{B}=( B )( A )\cos \theta =B \left \| \proj_{\vec{B}}\vec{A}\right \|\label{projection}\tag{2.7.6} \end{equation}

So, the dot product of \(\vec{A}\) and \(\vec{B}\) gives us the projection of \(\vec{A}\) onto \(\vec{B}\) times the magnitude of \(\vec{B}\text{.}\) So, to find the scalar value of the projection of \(\vec{A}\) onto \(\vec{B}\) we write

\begin{equation} \left \|\proj_{\vec{B}}\vec{A}\right \|=\underset{\text{calculus version}}{\left \| \frac{\left (\vec{A}\cdot \vec{B} \right )\vec{B}}{B^2}\right\|}=\frac{\vec{A}\cdot \vec{B}}{B}=\underset{\text{quick version}}{\vec{A}\cdot \vec{\hat{B}}}\\\tag{2.7.7} \end{equation}

While you might have learned the ‘calculus version’ if you have taken Calculus III there are simpler equivalent versions available. Rearranging (2.7.6) above, the projection of \(\vec{A}\) onto \(\vec{B}\) divided by the length of \(\vec{B}\text{.}\) This equation can be further simplified to the dot product of \(\vec{A}\) and the unit vector \(\hat{B}\text{.}\) As the unit vector \(\hat{B}\) has already been divided by the length of vector, \(\left \| \vec{B} \right \|\text{.}\)

Dot products always result in a scalar value: positive, negative, or zero. The spatial interpretation of the results of a dot product of \(\vec{A}\) and \(\vec{B}\) is:

List 2.7.2. Possible results from the magnitude of the projection of \(\vec{A}\) and \(\vec{B}\) and the spatial interpretation or each result
  • Positive value—\(\vec{A}\) and \(\vec{B}\) are generally in the same direction

  • Negative value—\(\vec{A}\) and \(\vec{B}\) are generally in opposing directions

  • Zero—\(\vec{A}\) and \(\vec{B}\) are perpendicular and thus none of \(\vec{A}\) acts parallel to \(\vec{B}\text{.}\)

  • Magnitude smaller than \(\vec{A}\)— This is the most common answer. The vectors are neither parallel nor perpendicular.

  • Magnitude equal to \(\vec{A}\)—\(\vec{A}\) is parallel to \(\vec{B}\text{,}\) thus 100% of \(\vec{A}\) is in the direction of \(\vec{B}\text{.}\)

  • Magnitude larger than \(\vec{A}\)— This answer is impossible. Check your algebra; you might have forgotten to divide by the magnitude of \(\vec{B}\text{.}\)

One final modification you may need to perform is to find the vector projection of \(\vec{A}\) onto \(\vec{B}\text{,}\) as opposed to the scalar value which we solve for in equation (2.7.6) above. To project the scalar value onto \(\vec{B}\text{,}\) multiply the scalar projection you solve for above by the unit vector \(\hat{\vec{B}}\text{.}\) In reference to our earlier cable example, the vector projection of \(\vec{A}\) onto \(\vec{B}\) would be the tension components of cable \(\vec{A}\) which are parallel to cable \(\vec{B}\text{.}\)

\begin{equation} \proj_{\vec{B}}\vec{A}=\underset{\text{calculus version}}{\frac{\left (\vec{A}\cdot \vec{B} \right )\vec{B}}{B^2}}=\underset{\text{quick version}}{\left (\vec{A}\cdot \hat{B} \right )\hat{B}}\tag{2.7.8} \end{equation}

Similar to equation (2.7.6) above, both the calculus version and the quick version are shown.

You can use this interactive as an example to test your computations and sketches by moving the slider to the left, changing the vectors, doing your computations, and then moving the slider to the right to check your work.

Subsection 2.7.4 Vector Magnitude vs. Scalar Value

The magnitude of a vector and the scalar result of a dot product may seem similar as they are both are numeric values which come from a vector or vectors. They are not the same, however. The key difference is that vector magnitudes are always positive or zero, while the scalar results of dot products are signed values which can be positive or negative.

List 2.7.3. Vector and the scalar result of a dot product.
  • Vector magnitude \(\left | \vec{A}\right |\text{ or }A\text{.}\)

    Magnitudes are defined as the length of a vector and are independent of the direction; thus, all magnitudes are positive or zero.

  • Scalar value of a dot product \(\vec{A}\cdot\vec{B}\text{.}\)

    Dot products project one vector along another and give a scalar value. Scalar values can be negative, zero, or positive. Thus, the result of a dot product or the scalar value of a vector operation, which are indicated by double lines around the vector operation, could be negative, and the negative should be preserved.

  • Scalar value of a vector operation \(\left \| \proj_{\vec{B}}\vec{A}\right \|\text{.}\)

Subsection 2.7.5 Dot Products and Projections

This section builds on the basics of dot products started in Section 2.7 earlier in this chapter. Recall that dot products find the amount of one vector parallel to another and are also useful to find the angle between two vectors.

Previously, we found that the dot product of the parallel unit vectors \(\ihat\) and \(\jhat\) was 1, while the dot product of the perpendicular unit vectors \(\ihat\) and £ was 0. We can expand this general relationship where the dot products of any two parallel unit vectors equal one and the dot product of any two perpendicular unit vectors is zero to demonstrate that

\begin{align*} \ihat \cdot \ihat \amp = 1 \amp \jhat \cdot \ihat \amp = 0 \amp \khat \cdot \ihat \amp = 0\\ \ihat \cdot \jhat \amp = 0 \amp \jhat \cdot \jhat \amp = 1 \amp \khat \cdot \jhat \amp = 0\\ \ihat \cdot \khat \amp = 0 \amp \jhat \cdot \khat \amp = 0 \amp \khat \cdot \khat \amp = 1 \end{align*}

For three-dimensional vectors we can also write that a dot product is equal to the sum-product of the like components:

\begin{equation*} \vec{A}\cdot \vec{B} =A_x B_x +A_y B_y + A_z B_z=\left ( A \right )\left ( B \right )\cos \theta \end{equation*}

Just like we did for two-dimensional dot products, our goal is to find the amount of tension force \(\vec{F}_A\) which is parallel to tension force \(\vec{F}_B\text{.}\) In two-dimensional problems it can be straightforward to create a right triangle to resolve the projected length of \(\vec{F}_A\) onto \(\vec{F}_B\text{,}\) on three-dimensional problems you’ll need to rely on the dot product from Equation XX above. As shown in the equation below, the easiest way to find the magnitude of the projection of \(\vec{F}_A\) onto \(\vec{F}_B\) is by dotting \(\vec{F}_A\) with \(\hat{F_B}\text{.}\)

\begin{equation} \left \| \proj_{\vec{F}_B}\vec{F}_A\right \|=\underset{\text{Calculus version}}{\left \| \frac{\left (\vec{F}_A\cdot \vec{F}_B \right )\vec{F}_B}{B^2}\right\|}=\frac{\vec{F}_A\cdot \vec{F}_B}{B}=\underset{\text{quick version}}{\vec{F}_A\cdot \hat{\vec{F}}_B}\tag{2.7.9} \end{equation}

As mentioned earlier, dot products always result in a scalar value. Refer to List 2.7.3 help you to interpret the results of a dot product of \(\vec{F}_A\) and \(\vec{F}_B\text{.}\)

One final modification you may need to perform is to find the vector projection of \(\vec{F}_A\) onto \(\vec{F}_B\) (as opposed to the scalar value which we solve for in equation XX above). To project the scalar value onto \(\vec{F}_B\text{,}\) just multiply the scalar projection you solve for above by the unit vector \(\hat{B}\text{.}\) In reference to our earlier cable example, vector projection of \(\vec{F}_A\) onto \(\vec{F}_B\) would be the tension components of cable \(\vec{F}_A\text{,}\) which are parallel to cable \(\vec{F}_B\text{.}\)

\begin{equation} \proj_{\vec{F}_B}\vec{F}_A=\underset{\text{calculus version}}{\frac{\left (\vec{F}_A\cdot \vec{F}_B \right )\vec{F}_B}{B^2}}=\underset{\text{quick version}}{\left (\vec{F}_A\cdot \hat{\vec{F}}_B \right )\hat{\vec{F}}_B}\tag{2.7.10} \end{equation}

Similar to equation XX above, both the calculus version and quick version are shown.

The final topic which can be a useful application of dot products is to find the vector portion of \(\vec{F}_A\) which is perpendicular to \(\vec{F}_B\text{.}\) Since we already have the vector portion of \(\vec{F}_A\) which is parallel to \(\vec{F}_B\) (which is the \(\proj_{\vec{F}_B}\vec{F}_A\)), we can use vector algebra to show the following:

\begin{equation*} \vec{F}_A=\underset{\proj_{\vec{F}_B}\vec{F}_A}{\overrightarrow{\vec{F}_A \parallel \vec{F}_B}}+ \overrightarrow{\vec{F}_A \perp \vec{F}_B} \end{equation*}

If we rearrange this equation to solve for \(\vec{F_A \perp F_B}\text{,}\) we find that

\begin{equation*} \vec{F_A \perp F_B}=\vec{F}_A - \vec{F_A \parallel F_B} \end{equation*}

Thus, we can use all of our efforts to compute the portion of \(\vec{F}_A\) to \(\vec{F}_B\) to quickly compute the vector portion of \(\vec{F}_A\) which is perpendicular to \(\vec{F}_B\text{.}\)

This interactive allows you to input the vector components of \(\vec{F}_A\) and \(\vec{F}_B\) and then compute the magnitude of the projection of \(\vec{F}_A\) onto \(\vec{F}_B\) (\(\left \| \proj_{\vec{F}_B}\vec{F}_A \right \|\)), the vector projection of \(\vec{F}_A\) onto \(\vec{F}_B\) (\(\proj_{\vec{F}_B}\vec{F}_A\)) and also the vector portion of \(\vec{F}_A\) which is perpendicular to \(\vec{F}_B\text{.}\)

Figure 2.7.4. Dot Product in Three Dimensions

Subsection 2.7.6 Force Vectors from Position Vectors

When translating two-dimensional force vectors from the problem geometry, we were able to use right triangle trigonometry. However, translating three-dimensional force vectors from the problem geometry often requires the use of unit vectors. The process for resolving three-dimensional vector components of a force along a line is described step-by-step below.

  1. Use the problem geometry to find the displacement vector from point \(A\) to point \(B, \vec{AB}\text{.}\) There are two approaches:

    1. Subtract the coordinates of the starting point \(A\) from the coordinates of the destination point \(B\) to find the vector \(\vec{AB}\)

      \begin{align*} A \amp=\left(A_x,A_y,A_z \right)\\ B \amp=\left(B_x,B_y,B_z \right)\\ \vec{AB}\amp =\left(B_x-A_x \right )\ihat+\left(B_y-A_y \right )\jhat+\left(B_z-A_z \right )\khat \end{align*}
    2. Write the displacements directly by noting the distance traveled in each coordinate direction when moving from \(A\) to \(B\text{.}\) This is really the same as the previous method.

      \begin{align*} AB_x \amp = \Delta x = B_x - A_x\\ AB_y \amp = \Delta y = B_y - A_y\\ AB_z \amp = \Delta z = B_z - A_x\\ \vec{AB}\amp = \Delta x \ihat+ \Delta y \jhat+ \Delta z \khat \end{align*}
  2. Find the distance between point \(A\) and point \(B\) using the Pythagorean Theorem. This distance is also the magnitude of \(\vec{AB}\) or \(|\vec{AB}|\)

    \begin{equation*} \left|\vec{AB}\right |=\sqrt{(AB_x)^2+(AB_y)^2+(AB_z)^2}\text{.} \end{equation*}
  3. Find the unit vector from \(A\) to \(B\text{,}\) \(\widehat{\vec{AB}}\) by dividing vector \(\vec{AB}\) by its magnitude. This is a unitless vector with a magnitude of 1 which points from \(A\) to \(B\text{.}\)

    \begin{equation*} \widehat{\vec{AB}}= \left \langle \frac{A_x}{|A|},\frac{A_y}{|A|},\frac{A_z}{|A|} \right \rangle \end{equation*}
  4. Multiply the magnitude of the force by the unit vector \(\widehat{AB}\) from \(A\) to \(B\) to get force \(\vec{F}_{AB}.\)

    \begin{align*} \vec{F}_{AB} \amp = F_{AB} \; \widehat{\vec{AB}}\\ \amp = F_{AB} \left \langle \frac{A_x}{|\vec{A}|},\frac{A_y}{|\vec{A}|},\frac{A_z}{|\vec{A}|}\right \rangle \end{align*}

This interactive allows you to input the coordinates of two points, \(A\) and \(B\text{,}\) and then see the displacement vector \(\vec{AB}\) from \(A\) to \(B\text{.}\) Additionally, you can see unit direction vector \(\vec{AB}\) and \(\vec{F}_{AB}\text{,}\) which is a force acting in this same direction with the set magnitude in \(\kN{}\text{.}\) You can use this interactive to practice your computations of position vectors, unit vectors, and force vectors. Note that you can click on the three-dimensional drawing to adjust the viewing perspective and also that GeoGebra displays vector components as a column vector.

Figure 2.7.5. Unit Vectors in Space
Example 2.7.2. Find a force in a specified direction.

Determine the components of a \(\kN{5}\) force \(\vec{F}\) acting at point \(A\text{,}\) in the direction of a line from \(A\) to \(B\text{.}\) Given: \(A =\m{ \left ( 2,3,-2.1 \right )}\) and \(B = \m{\left ( -2.5, 1.5, 2.2 \right )}\)

(a)

Draw a good diagram.

Hint

The interactive in Figure 2.7.6 may be useful for this problem.

(b)

Find the displacement vector from \(A\) to \(B\text{.}\)

Answer
\begin{align*} \vec{AB} \amp=\m{\left <-4.5,-1.5,4.3\right >} \end{align*}
Solution
\begin{align*} \vec{AB} \amp =\left(B_x-A_x \right )\ihat+\left(B_y-A_y \right )\jhat+\left(B_z-A_z \right )\khat\\ \amp =\m{\left [ \left(-2.5-2 \right )\ihat+\left(1.5-3 \right )\jhat+\left(2.2-(-2.1) \right )\khat \right ]}\\ \amp =\m{ \left(-4.5\ihat-1.5\jhat+4.3 \khat \right )}\\ \amp=\m{\left <-4.5,-1.5,4.3\right >} \end{align*}
(c)

Find the magnitude of the displacement vector.

Answer
\begin{align*} \left|\vec{AB}\right |\amp = \m{6.402} \end{align*}
Solution
\begin{align*} \left|\vec{AB}\right |\amp =\sqrt{(\Delta_x)^2+(\Delta_y)^2+(\Delta_z)^2}\\ \amp =\sqrt{\m{(-4.5)^2+(-1.5)^2+4.3^2 }^2}\\ \amp =\sqrt{40.99 \m{}^2 }\\ \amp = \m{6.402} \end{align*}
(d)

Find the unit vector pointing from \(A\) to \(B\text{.}\)

Answer
\begin{align*} \widehat{\vec{AB}} \amp =\left\langle -0.7,-0.23,0.67\right \rangle \end{align*}
Solution
\begin{align*} \widehat{\vec{AB}}\amp= \left \langle \frac{\Delta_x}{|\vec{AB}|},\frac{\Delta_y}{|\vec{AB}|},\frac{\Delta_z}{|\vec{AB}|} \right \rangle \\ \amp =\left \langle \frac{-4.5}{6.402},\frac{-1.5}{6.402},\frac{4.3}{6.402}\right \rangle\\ \widehat{\vec{AB}} \amp =\left\langle -0.7,-0.23,0.67\right \rangle \end{align*}
(e)

Find the force vector.

Answer
\begin{gather*} \vec{F}_{AB}= \kN{ \left \langle -3.51,-1.17,3.36 \right \rangle } \end{gather*}
Solution
\begin{align*} \vec{F}_{AB} \amp = F_{AB} \; \widehat{\vec{AB}}\\ \amp =\kN{5} \left \langle -0.7,-0.23,0.67\right \rangle\\ \amp = \kN{ \left \langle -3.51,-1.17,3.36 \right \rangle } \end{align*}

Once you understand the process of creating a force vector from the problem geometry, try your own computations using the interactive below in Figure 2.7.6.

This interactive allows you to input two points, \(A\) and \(B\text{,}\) and then will show the displacement vector \(\vec{r}\) from \(A\) to \(B\text{.}\) Additionally, the interactive will compute a unit vector \(\lambda_{AB}\) along that line. You can use this interactive to practice your computations of position vectors, unit vectors, and force vectors. Note that you can click on the three-dimensional drawing to adjust the viewing perspective and also that GeoGebra displays vectors components as a column vector,

\begin{equation*} \vec{A} = \begin{pmatrix}A_x\\A_y\\A_z\end{pmatrix}\text{.} \end{equation*}
Figure 2.7.6. Unit Vectors in Space