The dot product of two nonzero real vectors and
is the scalar
|
(1)
|
where is the vector
angle and
is the Euclidean norm. The dot product is zero
if either vector is zero or if the two nonzero vectors
are perpendicular.
For , let
be the unit vector
in its direction. The scalar projection of
onto this direction is
|
(2)
|
For nonzero ,
this equals
.
Thus,
is the scalar projection multiplied by
, not the projection
length alone. The vector projection, shown in
red in the illustration, is
|
(3)
|
and its length is .
The scalar projection is negative when
is an obtuse
angle, whereas the length is always nonnegative. For example, the projection
of
onto
is
and has length 4, but
. Interchanging the vectors
changes the projection but leaves the dot product
unchanged.
By writing
|
(4)
| |||
|
(5)
|
it follows that (1) yields
|
(6)
| |||
|
(7)
| |||
|
(8)
| |||
|
(9)
|
So, in general,
|
(10)
| |||
|
(11)
|
This can be written very succinctly using Einstein summation notation as
|
(12)
|
The dot product is implemented in the Wolfram Language as Dot[a, b], or simply by using a period, a . b.
The dot product is commutative
|
(13)
|
and distributive
|
(14)
|
The associative property is meaningless for the dot product because
is not defined since
is a scalar and therefore cannot itself be dotted. However,
it does satisfy the property
|
(15)
|
for a scalar.
The derivative of a dot product of vectors is
|
(16)
|
The dot product is invariant under rotations
|
(17)
| |||
|
(18)
| |||
|
(19)
| |||
|
(20)
| |||
|
(21)
| |||
|
(22)
|
where Einstein summation has been used.
The dot product is also called the scalar product and inner product. In the latter context, it is usually written . The dot product is also defined for tensors
and
by
|
(23)
|
So for four-vectors
and
, it is defined by
|
(24)
| |||
|
(25)
| |||
|
(26)
|
where
is the usual three-dimensional dot product.