Dot Product

1 min read

The dot product (inner product) of two vectors a,bRn\mathbf{a}, \mathbf{b} \in \mathbb{R}^n can be understood through two equivalent views:

  1. Algebraic view — multiply corresponding entries and sum: ab=i=1naibi\mathbf{a} \cdot \mathbf{b} = \sum_{i=1}^{n} a_i b_i
  2. Geometric view — project one vector onto the other: ab=abcosθ\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\| \|\mathbf{b}\| \cos\theta, where θ\theta is the angle between them

The dot product is commutative (ab=ba)(\mathbf{a} \cdot \mathbf{b} = \mathbf{b} \cdot \mathbf{a}), distributive over addition, and linear in each argument.

Key geometric facts:

  • ab>0\mathbf{a} \cdot \mathbf{b} > 0 means the vectors point in roughly the same direction
  • ab=0\mathbf{a} \cdot \mathbf{b} = 0 means the vectors are orthogonal (perpendicular)
  • ab<0\mathbf{a} \cdot \mathbf{b} < 0 means they point in roughly opposite directions
  • aa=a2\mathbf{a} \cdot \mathbf{a} = \|\mathbf{a}\|^2 gives the squared length of the vector

The dot product is the building block of matrix multiplication: each entry of ABAB is a dot product of a row of AA with a column of BB.

See also: Matrix Multiplication, Rank and Null Space, Eigendecomposition

Linked from