Dot Product of Two Vectors

The dot product is a fundamental concept in vector mathematics that help understand the relationship between two vectors. It is widely used to find angles, measure projections, and solve problems in physics, engineering, computer graphics,etc. In this guide, you will learn the dot product formula, its properties, and how to calculate it step by step with simple explanations and examples.


Table of Contents


What is the Dot Product of Two Product?

The dot product, also called the scalar product or inner product tells how much of one vector points in the same direction as another.
The dot product of two vectors is the product of the magnitude of the two vectors and the cosine of the angle between them.
A vector carries both magnitude and direction. The dot product of two vectors is one way to multiply two vectors. The result of dot product of two vectors is always a scalar quantity and hence also known as scalar product.
The dot product of two vectors a→ and  b→ is denoted by a→⋅b→
and is defined as
 ‖a→‖‖b→‖cos⁡θ.

  • The resultant of the dot product of two vectors lie in the same plane of the two vectors 

  • The dot product may be a positive real number or a negative real number or a zero.


The Dot Product Formula

The dot product can be expressed in two completely equivalent ways. 

  • Algebraic form (using components):

Let a and b be two vectors,
For two 3D vectors a=(a1,a2,a3)and  b=(b1,b2,b3):
a·b=a1b1+a2b2+a3b3

For 2D vectors  a=((a1,a2)and b=(b1,b2):
 a·b=a1b1+a2b2

  • Geometric form (using magnitude and angle)

If you know the magnitudes of the two vectors and the angle θ between them, use the geometric formula: Let a and b be two vectors,
 a⋅b=‖a‖‖b‖cos⁡θ
where θ is the angle between the two vectors (0° ≤ θ ≤ 180°).


How to Calculate the Dot Product

  • Using the component formula

  1. Write both vectors in component form: a=(a1,a2,a3) and  b=(b1,b2,b3).
  2. Multiply the first components:  a1×b1
  3. Multiply the second components: a2×b2
  4. Multiply the third components: a3×b3
  5. Add all three products:  a1b1+a2b2+a3b3
  • Using the geometric formula

  1. Find the magnitude  |a|=√(a12+a22+a32)
  2. Find the magnitude |b|=√(b12+b22+b32)
  3. Identify the angle θ between the vectors .
  4. Compute  |a|×|b|×cos(θ)


Properties of Dot Product

The dot product follows a consistent set of algebraic rules. 

Property

Statement

Explanation

Commutative Property

a · b = b · a

Order doesn't matter. a · b gives the same result as b · a.

Distributive Property

a · (b + c) = a·b + a·c

The dot product distributes over vector addition

Scalar Assosciative

(ka) · b = k(a · b)

Scalar factors can be pulled out freely

Self Dot Product

 a·a=|a|2

Dot product of a vector with itself gives the square of its magnitude.

Orthogonality

a · b = 0 ⟺ a ⊥ b

If the dot product is zero (and neither vector is zero), the two vectors are perpendicular.

Unit Vector

î·î = ĵ·ĵ = k̂·k̂ = 1

î·ĵ = ĵ·k̂ = k̂·î = 0

The standard basis vectors are orthogonal (perpendicular) to each other

Zero Vector

0 · a = 0

Dot product of the zero vector anything is always zero.

 

Finding the Angles between Two Vectors

The cosine of the angle between two vectors is equal to the sum of the products of the individual constituents of the two vectors, divided by the product of the magnitude of the two vectors.
The formula for the angle between the two vectors is given by:
 cos⁡θ=a→⋅b→‖a→‖‖b→‖
If  a→=a1i^+a2j^+a3k^and  b→=b1i^+b2j^+b3k^
Then,
 cos⁡θ=a1b1+a2b2+a3b3a12+a22+a32b12+b22+b32

The sign of the dot product tells the quadrant : 

  • Positive (a · b > 0): angle is less than 90°, vectors have a positive component in the same direction.

  • Zero (a · b = 0) :angle is exactly 90° , vectors are perpendicular to each other(orthogonal).

  • Negative (a · b < 0) : angle is greater than 90°,vectors mostly oppose each other.

Projection and Dot Product

Scalar Projection: The scalar projection of vector a onto vector b is how much of a lies along the direction of b.

 

Scalar projection of a onto b = (a·b)|b|.

Scalar projection of b onto a =  (a·b)|a|.

  • This gives a scalar (number)

  • It tells you how much of a\mathbf{a}a lies in the direction of b.

  • It has no direction, only magnitude (can be positive or negative)

Vector Projection: The vector projection is that shadow in the form of a vector. It points in the direction of b.

 projb(a)=(a⋅b‖b‖2)b

  • This gives a vector

  • It represents the actual projection of a onto b

  • It has both magnitude and direction (same direction as b) 

Dot Product vs Cross Product

There are two vector multiplications: the dot product and the cross product. 

Feature

Dot Product (a · b)

Cross Product (a × b)

Result type

Scalar

Vector

Geometric meaning

How much the vectors align (projection)

The cross product gives a vector that is perpendicular to both given vectors, and its magnitude represents the area of the parallelogram formed by them.

Zero condition

Zero when vectors are perpendicular

Zero when vectors are parallel

Commutativity

a · b = b · a (commutative)

a × b = −b × a (anti-commutative)

Primary Uses

Angles, projection, work, similarity

Torque, normal vectors, area, rotation

 

Solved Examples for Dot Product

Example 1: Find the dot product of a = (3, 5, 2) and b = (−1, 3, 0).
Solution: Given, a = (3, 5, 2) and b = (−1, 3, 0)
 a1b1+a2b2+a3b3 = (-1 × 3) +  (5 × 3) + (2 × 0) = 12
Therefore, a · b = 12.

Example 2: Two vectors have magnitudes |a| = 6 and |b| = 4, and the angle between them is 60°. Find a · b.
Solution: Given,  |a| = 6, |b| = 4 and θ = 60°.
|a| × |b| × cos(θ) = 6 × 4 × cos(60) =  6 × 4 × (1/2) = 12.
Therefore, a · b = 12.

Example 3: Find the angle between a = (1, 2, 2) and b = (3, 0, 4).
Solution: Given: a = (1, 2, 2) and b = (3, 0, 4)
cos θ = (a · b) / (|a| |b|)
a · b = (1)(3) + (2)(0) + (2)(4) = 3 + 0 + 8 = 11
|a| = √(1² + 2² + 2²) = √(1 + 4 + 4) = √9 = 3
|b| = √(3² + 0² + 4²) = √(9 + 0 + 16) = √25 = 5
cos θ = 11 / (3 × 5) = 11/15 ≈ 0.7333
θ = cos⁻¹(11/15) ≈ 42.8°

Example 4: Are the vectors a = (2, −3, 1) and b = (3, 2, 0) perpendicular?
Solution: Compute a · b = (2)(3) + (−3)(2) + (1)(0) = 6 − 6 + 0 = 0
Since a · b = 0 and neither vector is the zero vector, they are perpendicular.

Example 5: Find the scalar projection of vector  a=2i^+3j^ on vector b=i^+4j^
Solution: Scalar projection of a onto b = \frac{(a · b)}{|b|}
a⋅b = (2)(1) + (3)(4) = 2 + 12 = 14
|b| = √(1²+ 4²) = √(1 + 16) = √17
Scalar projection of a onto b = 14√17

Real life Applications of Dot Product

Here are a few real-life applications of the dot product in physics, engineering, and everyday systems.

  •  Physics (Work Done): Work is given by F⋅d. When a force is applied at an angle to the direction of motion, only the component along the path does work.

  •  Computer Graphics (Lighting): In lighting models, N⋅L gives how directly light hits a surface. It controls brightness in realistic rendering (Lambert shading).

  • Machine Learning (Similarity): The dot product (often normalised as cosine similarity) helps systems like search engines and recommenders measure how similar two data points are.

  • Structural Engineering: Engineers use dot products to break forces into useful directions along beams, cables, and supports for safe design.

  • Navigation & Vision Systems: The dot product helps check direction alignment, whether something is in front of a camera or within a sensor’s field of view.

  • Data Science (PCA): In Principal Component Analysis, data is projected onto new axes using dot products to reduce dimensions while preserving key patterns.

Frequently Asked Questions on Dot Product

1. What is the dot product in simple terms?

Dot product tells how much of one vector points in the same direction as another.

2. Can the dot product be negative?

Yes. The dot product is negative when the angle between the two vectors is greater than 90°.

3. What does a dot product of zero mean?

A dot product of zero means the two vectors are perpendicular (orthogonal) to each other.

4. What is the dot product of a vector with itself?

The dot product of a vector with itself equals the square of the vector's magnitude.  a·a=|a|2

ShareFacebookXLinkedInEmailTelegramPinterestWhatsApp

We are also listed in