In this explainer, we will learn how to find the dot product of two vectors in 3D.
The dot product, also called a scalar product because it yields a scalar quantity, not a vector, is one way of multiplying vectors together.
You are probably already familiar with finding the dot product in the plane (2D). You may have learned that the dot product of and is defined as , where is the angle between the two vectors and .
With a little bit of geometry, one can show that it can be calculated from the components of both vectors: , where and are the -components of and , and and are their -components.
Let us consider two vectors and that make angles and with the positive direction of the -axis respectively.
The angle between them is then . Given that we find that
Using the subtraction trigonometric identity , we find, by replacing with and with , that
As , we have
Moving on to 3D vectors, the definition of the dot product is unchanged.
Definition: Dot Product of Two 3D Vectors
where is the angle between and .
Let us look at our first example and apply the definition of the dot product.
Example 1: Finding the Dot Product of Two Vectors given the Norm of One of Them, the Components of the Other, and the Angle between Them
Suppose , , and the angle between the two vectors is . Find to the nearest hundredth.
Answer
We know that . We already know and the angle . We, therefore, need to find using the components of :
Now, substituting this value into our equation for , we find
How To: Calculating a Dot Product Using the Vectorβs Components
The dot product of 3D vectors is calculated using the components of the vectors in a similar way as in 2D, namely, where the subscripts , , and denote the components along the -, -, and -axes.
Let us apply this method with the next example.
Example 2: Finding the Dot Product of Two Vectors given Their Components
Given that and , determine .
Answer
We calculate here the dot product using where the subscripts , , and denote the components along the -, -, and -axes. We thus have
Now that we know how the dot product is defined and how to calculate it using the vectorsβ components, let us look at the properties of the dot product.
As the dot product is the product of the magnitudes of the vectors multiplied by the cosine of the angle between them, it is zero when the cosine of the angle between both vectors is zero. This happens when the angle between them is or (or ), that is, when they are perpendicular.
Property: Dot Product of Two Perpendicular Vectors
The dot product of two perpendicular vectors is zero. Inversely, when the dot product of two vectors is zero, then the two vectors are perpendicular.
To recall what angles have a cosine of zero, you can visualize the unit circle, remembering that the cosine is the -coordinate of point P associated with the angle .
We are going to use this property in the next two examples.
Example 3: Finding Missing Components of Orthogonal Vectors
For what value of are vectors and perpendicular?
Answer
If two vectors are perpendicular, then the angle between them is or (or ). In both cases, the cosine of the angle between them is zero. Therefore, the dot product between the two vectors is zero. In this question, it means that ; that is,
Hence, we have
Example 4: Identifying Perpendicular and Parallel Vectors
Which of the following is true of the vectors and ?
- They are parallel.
- They are perpendicular.
- They are neither parallel nor perpendicular.
Answer
If and are parallel, then there is a number such that . We would have
There is clearly no value of that verifies the three equations since we get three different solutions for each of them . Therefore, and are not parallel.
If and are perpendicular, then their dot product is zero. Let us work out their dot product:
Their dot product is not zero; therefore, and are not perpendicular.
The correct answer is that and are neither parallel nor perpendicular.
Other properties of the dot product arise from the fact that the cosine of the angle between the two vectors is one of its factors. For instance, given that the cosine function is even with a period of , this means that it does not matter if we take the angle from to or from to because
Therefore, the dot product is commutative:
Also, the dot product of two collinear vectors is plus or minus the product of their magnitudes. Indeed, let us consider, first, two collinear vectors and , with the angle between them being zero: since .
Let us now consider two collinear vectors and , with the angle between them being (i.e., the two vectors point to opposite directions): since .
It follows that the dot product of a vector with itself gives the square of its magnitude. This can be easily checked with the way we calculate the dot product: so
Since , we find that
Like multiplication, the dot product is distributive:
In addition, we have
Let us use these properties to answer the following question.
Example 5: Using the Distributivity of the Dot Product
If and are two perpendicular unit vectors, find .
Answer
There are two pieces of information in the phrase β and are two perpendicular unit vectors.β The first one is that the vectors are perpendicular, which means that their dot product is zero. The second one is that they are unit vectors, which means that they have magnitudes of 1. Now, using the distributive property of the dot product, we find that
As the vectors are perpendicular, the terms and are zero.
Also, we know that since is a unit vector. The same applies to . Hence, we find that
Key Points
- The dot product of vectors and is defined as where is the angle between the two vectors and .
- The dot product of 3D vectors can be calculated using the vectorsβ components:
- The dot product has the following properties:
- (commutativity),
- ,
- if and only if and are perpendicular,
- (distributivity),
- , where is a real number.