Dot Product

The inner product of two vectors — a scalar measuring alignment, enabling projections, angles, and the geometry of vector spaces.

The dot product measures how much two vectors point in the same direction
ab

Formula

a dot b = ||a||||b||cos(theta)

a dot b = 4.63

Positive means aligned. Zero means perpendicular. Negative means pointing against each other.

theta = 50°
Definition

The dot product (inner product) of two vectors a=(a1,â€Ķ,an)\mathbf{a} = (a_1, \ldots, a_n) and b=(b1,â€Ķ,bn)\mathbf{b} = (b_1, \ldots, b_n) is:

a⋅b=∑i=1naibi=a1b1+a2b2+â‹Ŋ+anbn\mathbf{a} \cdot \mathbf{b} = \sum_{i=1}^n a_i b_i = a_1 b_1 + a_2 b_2 + \cdots + a_n b_n

The result is a scalar (single number), not a vector.

Geometric meaning: a⋅b=âˆĨaâˆĨâˆĨbâˆĨcos⁥Îļ\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\| \|\mathbf{b}\| \cos\theta where Îļ\theta is the angle between the vectors.

  • a⋅b>0\mathbf{a} \cdot \mathbf{b} > 0: angle <90°< 90° (same general direction)
  • a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0: perpendicular (orthogonal)
  • a⋅b<0\mathbf{a} \cdot \mathbf{b} < 0: angle >90°> 90° (opposite directions)
Key properties
  • Commutative: a⋅b=b⋅a\mathbf{a}\cdot\mathbf{b} = \mathbf{b}\cdot\mathbf{a}
  • Distributive over addition: a⋅(b+c)=a⋅b+a⋅c\mathbf{a}\cdot(\mathbf{b}+\mathbf{c}) = \mathbf{a}\cdot\mathbf{b} + \mathbf{a}\cdot\mathbf{c}
  • Compatible with scalars: (ca)⋅b=c(a⋅b)(c\mathbf{a})\cdot\mathbf{b} = c(\mathbf{a}\cdot\mathbf{b})
  • a⋅a=âˆĨaâˆĨ2â‰Ĩ0\mathbf{a}\cdot\mathbf{a} = \|\mathbf{a}\|^2 \geq 0, with equality only when a=0\mathbf{a} = \mathbf{0}
Common mistakes
  • Confusing the dot product with the cross product: the dot product yields a scalar and works in any dimension; the cross product yields a vector and is specific to 3D
  • Dimension mismatch: the dot product is only defined for vectors of the same length — (1,2,3)⋅(1,2)(1,2,3)\cdot(1,2) is meaningless
Computing dot products

a=(3,−1,2)\mathbf{a} = (3, -1, 2), b=(1,4,−2)\mathbf{b} = (1, 4, -2).

a⋅b=3(1)+(−1)(4)+2(−2)=3−4−4=−5\mathbf{a} \cdot \mathbf{b} = 3(1) + (-1)(4) + 2(-2) = 3 - 4 - 4 = -5.

Since the result is negative, the vectors point in roughly opposite directions.

Try it

Find the dot product of (2,3)(2, 3) and (−3,2)(-3, 2). Are these vectors perpendicular?

Solution

(2)(−3)+(3)(2)=−6+6=0(2)(-3) + (3)(2) = -6 + 6 = 0. Yes, they are perpendicular — the dot product is zero, confirming Îļ=90°\theta = 90°.

This pair is a 90° rotation of each other — a general fact: (a,b)(a, b) and (−b,a)(-b, a) are always perpendicular.

Related concepts