Definition
Dot Product
Let
be two vectors of vector space , being a scalar field. The dot product
is an inner product defined as the sum over the dimension where the different operator symbols are just different notations.
Angle Formula
Let
Derivation
We derive formula by comparing two ways to compute
. First, for any vector
, its squared length is the dot product of the vector with itself: Set
, then: Expand the right-hand side. In coordinates:
Note that each
expands to . Hence: Given associativity and commutativity, group terms like:
which can be rewritten as:
Using the definitions of norm and dot product, this becomes
and
Substituting these back gives
For the usual dot product,
Now use
On the other hand,
These are two expressions for the same quantity, so
Cancel
Rearranging gives
so the angle can be recovered from the dot product.
Similarity
The dot product can be viewed as a measurement of similarity of two vectors because it quantifies how much two vectors are aligned. A higher dot product indicates greater degree of alignment or similarity between the vectors.
If
So:
- if
, then and the dot product is large and positive - if
, then and the dot product is - if
, then and the dot product is negative
This is why the dot product detects whether two vectors point in similar, orthogonal, or opposite directions.
Projections
Projection onto a Unit Vector
Start with a unit vector
If
Since
This is exactly the signed length of the part of
The corresponding vector projection is
For a general non-zero vector
Then
and the projection onto
This is why coefficients in an orthonormal basis can be recovered with the dot product. If
and the basis vectors satisfy
then for a fixed
So the dot product with