A dot product of two vectors is a unique way of combining two vectors resulting in a scalar. This operation, often symbolized by a centered dot, is dependent on the length of both vectors and the angle between them.
Intuitively, the Dot Product tells us how much two vectors point in the same direction. It essentially measures the relative direction of two vectors. The dot product is large when the angle between the vectors is small, indicating they point in a similar direction. Conversely, when the vectors are perpendicular, the dot product is zero.
In the following sections of this article, we will delve deeper into the concept of the dot product of 2 vectors, exploring its algebraic and geometric definitions, properties, and applications in various fields.
Table of Content
What is Dot Product of Two Vectors?
The Dot Product, also known as the Scalar Product, is an operation in mathematics that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number. In simpler terms, it multiplies corresponding components of two vectors and adds the products together.
Dot Product Definition
The dot product of two vectors, denoted by a â‹… b, is defined in two ways:
Algebraically: The dot product is the sum of the products of the corresponding entries of the two sequences of numbers.
a ⋅ b = ∑ (a_i * b_i)
Where:
- a and b are the vectors.
- i iterates over all dimensions (1 to n, where n is the number of dimensions).
- ai and bi represent the corresponding components of vectors a and b.
Geometrically: It is the product of the Euclidean magnitudes of the two vectors and the cosine of the angle between them.

a ⋅ b = |a| |b| cos(θ)
Where:
- |a| and |b| are the magnitudes (lengths) of vectors a and b, and
- θ is the angle between them.
Angle Between Two Vectors Using Dot Product
The dot product formula can be rearranged to find the angle (θ) between two vectors (a and b) using the following formula:
cos(θ) = \dfrac{(a ⋅ b)} {(|a| |b|)}
This formula utilizes the property that the cosine of the angle between two vectors is equal to their dot product divided by the product of their magnitudes.
Magnitude of a Vector
The magnitude of a vector, also known as the length or norm of the vector, is a measure of its size. It is calculated as the square root of the sum of the squares of its components.
Formula
For a vector v=⟨v1,v2,v3⟩ in three-dimensional space, the magnitude ∣v∣ is given by:
​​
|\mathbf{v}| = \sqrt{v_1^2 + v_2^2 + v_3^2}
For a vector v=⟨v1,v2⟩ in two-dimensional space, the magnitude ∣v∣ is given by:
|\mathbf{v}| = \sqrt{v_1^2 + v_2^2}
Projection of a Vector
The projection of vector a onto vector b can be calculated using the dot product and vector magnitude. The formula in terms of vectors a and b is:
\text{proj}_{b}(a) = \frac{a \cdot b}{\|b\|^2} \cdot b
Here, a â‹… b represents the dot product of vectors a and b, |b| denotes the magnitude (or length) of vector b, and projb(a) represents the projection of vector a onto vector b.
Working Rule to Find The Dot Product of Two Vectors
- Identify the vectors: Ensure you have two vectors with the same number of dimensions.
- Multiply corresponding components: For each dimension, multiply the components from each vector together.
- Sum the products: Add the multiplied components together.
- The result is the dot product.
Matrix Representation of Dot Product of Two Vectors
The dot product can also be calculated using matrix multiplication, especially when dealing with higher-dimensional vectors. If vectors a and b are represented as row matrices, then their dot product can be obtained using the following matrix multiplication:
a â‹… b = a_{row} * b_{row}^T
Where:
a_{row} is the row matrix representation of vector a.b_{row}^T is the transpose of the row matrix representation of vector b.
Dot Product of Unit Vectors
A unit vector is a vector with a magnitude of 1.
The dot product of two unit vectors simplifies to the cosine of the angle between them because the magnitude terms (|a| and |b|) in the formula become 1.
Properties of Dot Product
The dot product has several important properties, including:
- Commutative: a â‹… b = b â‹… a
- Distributive: a â‹… (b + c) = a â‹… b + a â‹… c
- Associative with scalar multiplication: k(a â‹… b) = (ka) â‹… b = a â‹… (kb)
Applications of Dot Product
The dot product has numerous applications in various fields, including:
- Geometry: Calculating lengths, angles, projections of vectors.
- Graphics: Lighting calculations, 3D transformations.
- Physics: Work done by a force, power, potential energy.
- Machine Learning: Inner product in linear algebra used in algorithms like Support Vector Machines.
Solved Examples on Dot Product of Two Vectors
Here are some examples to illustrate how to find the dot product:
Example 1: Find the dot product of vectors a = [1, 2] and b = [3, 4].
Solution:
a â‹… b = (1 * 3) + (2 * 4) = 11
Example 2: Calculate the angle between vectors a = [2, 1] and b = [1, 3] using the dot product.
Solution:
To calculate the angle between vectors a = [2, 1] and b = [1, 3] using the dot product, you can use the formula:
\cos(\theta) = \frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{a}\| \cdot \|\mathbf{b}\|} a⋅b = (2×1) + (1×3) = 2+3 = 5
∥?∥ = 22 + 12 = 4 + 1 = 5∥a∥ = 22 + 12 ​= 4 + 1 ​= 5​
∥?∥ = 12 + 32 = 1 + 9 = 10∥b∥ = 12 + 32 ​= 1 + 9 ​= 10​
Plugging these values into the formula:
\cos(\theta) = \frac{5}{\sqrt{5} \cdot \sqrt{10}} = \frac{5}{\sqrt{50}} = \frac{5}{\sqrt{25 \cdot 2}} = \frac{5}{5\sqrt{2}} = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} Taking the inverse cosine to find the angle:
\theta = \cos^{-1}\left(\frac{\sqrt{2}}{2}\right) = 45^\circ
Example 3: Consider two matrices A and B:
A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}
Find the dot product of these matrix.
Solution:
To find the dot product of these matrices, we first need to take the transpose of matrix B and then multiply corresponding elements of the matrices and sum them up.
A \cdot B^T = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \cdot \begin{bmatrix} 5 & 7 \\ 6 & 8 \end{bmatrix}
A \cdot B^T = \begin{bmatrix} (1 \times 5 + 2 \times 6) & (1 \times 7 + 2 \times 8) \\ (3 \times 5 + 4 \times 6) & (3 \times 7 + 4 \times 8) \end{bmatrix}
A \cdot B^T = \begin{bmatrix} (5 + 12) & (7 + 16) \\ (15 + 24) & (21 + 32) \end{bmatrix}
A \cdot B^T = \begin{bmatrix} 17 & 23 \\ 39 & 53 \end{bmatrix}
Practice Problems on Dot Product
1. The dot product of two vectors A and B is denoted by:
a) A * B
b) A â‹… B (correct)
c) A / B
d) A || B
2. If the dot product of two vectors is 0, what can you conclude about the vectors?
a) They are parallel.
b) They are perpendicular (correct).
c) They have equal magnitudes.
d) None of the above.
3. The dot product of a vector with itself is always:
a) 0
b) 1 (correct)
c) Equal to the magnitude of the vector.
d) Dependent on the direction of the vector.
4. Consider vectors A = [2, 3] and B = [1, -4]. What is the dot product of A and B?
a) -10 (correct)
b) 11
c) 14
d) 23
5. The geometric interpretation of the dot product involves:
a) The sum of the vectors' magnitudes.
b) The angle between the vectors and their magnitudes dot
c) The difference between the vectors' directions.
d) The cross product of the vectors.
Related Articles: