An inner product is a generalization of the dot product. In a vector space, it is a way to multiply vectors together, with the result of this multiplication being a scalar.
The inner product (scalar product) of two n-dimensional vectors is defined as:
- which is equivalent to
Two (non-zero) vectors are orthogonal if and only if their inner product is zero (i.e. )
When two vectors are linearly independent, it means neither vector is a scalar multiple of the other (at an angle different than 0 or 180). Two orthogonal vectors are linearly independent.
The inner product can be used to project a vector on another.
![]()
![]()
In the vectors shown here:
Notice that the result of the projection of a vector on a vector is a scalar (the signed length of the shadow along the line, see the red vertical line)
The length of the projection is proportional to the inner product of the projected vector (scaled by the length of the projection vector).
- what this means is that if is not a unit vector, the raw dot product is inflated by . To get the exact geometric shadow length, I must divide out by . If the target vector is already unit length, the dot product directly equals the shadow length.