A dot product measures how much two Euclidean vectors point along each other. This article uses real Euclidean vectors in , with the usual Cartesian basis: multiply matching coordinates and add,
The result is a scalar, while is the Euclidean norm. This real convention has no complex conjugation; for vectors over the complex numbers, use the convention specified in inner product.
For two nonzero Euclidean vectors, the same dot product records their angle through the cosine:
Here is an inverse trigonometric function. The Cauchy-Schwarz inequality guarantees that the normalized ratio lies in . The zero vector has dot product zero with every vector, but its angle is undefined: the ratio would divide by zero. To outline the geometric identity, expand and compare with the law of cosines.[ref]
Take and . Their Euclidean norms are and , and
The unit vector selects the horizontal direction. The scalar projection says how far reaches along that direction; its vector projection is . Thus splits into an aligned part and an orthogonal projection residual.
Figure 1.
The vector projection of onto the horizontal line is ; the orthogonal projection residual is and the angle is
. Details.
For , the dot product proves orthogonality; both Euclidean norms are . For , : the scalar projection onto is , because reaches against that chosen direction. Its angle with is .
Keeping fixed and choosing of Euclidean norm gives . At angles , the dot products are . Positive values mean partial alignment, zero means orthogonality, and negative values mean a component against the other direction.
Figure 2.
With Euclidean norms and , the dot product follows ; equal-length arrows show positive, zero, and negative alignment with
. Details.
This interpretation explains work: for a constant force and a straight displacement , counts the force component along the motion. A sideways force contributes zero work, and an opposing force contributes negative work.[ref]
For two sparse vectors stored as increasing nonzero-coordinate streams, advance whichever current index is smaller; that coordinate has no possible partner in the other remaining stream. At equal indices, accumulate the product and advance both. The loop invariant accounts for all matched coordinates already passed and excludes any future match for skipped smaller coordinates. Termination occurs when either stream ends. The method uses time and constant auxiliary space, with floating-point results subject to the chosen evaluation order.
For nonzero real vectors in a Euclidean space, their angle is determined by the displayed dot product formula. The Cauchy-Schwarz inequality puts the quotient in , so the inverse cosine is defined. Perpendicular vectors have angle , parallel vectors pointing the same way have angle zero, and those pointing in opposite directions have angle . A zero vector has no uniquely defined direction and hence no angle by this definition.
For nonzero vectors in a complex inner product space, the displayed quotient defines the ordinary real angle in the underlying real inner product space, whose inner product is . The complex Cauchy-Schwarz inequality bounds it between and . This convention depends on the vectors' phase factors. The different phase-invariant convention measures an angle between complex one-dimensional subspaces; the two conventions should not be interchanged.
The scalar projection of a real Euclidean vector onto a nonzero Euclidean vector is its signed component along the unit vector :
For , the scalar projection onto is , while that onto is . Reversing the measuring direction reverses the sign; the scalar projection is not necessarily a nonnegative length. For nonzero , it also equals , using the angle with and its cosine. For the zero vector it is zero, even though that angle is undefined.
The vector projection multiplies the scalar projection by the chosen unit vector, giving the orthogonal projection onto the linear span of a nonzero real Euclidean vector :
For and , this gives and ; the dot product checks the orthogonal projection residual. Replacing by gives the same : reversing direction changes the scalar projection, but preserves the vector projection onto the line.
For a short proof of the nearest-point property, any vector on this line satisfies by the Pythagorean identity. The second term is uniquely minimized at . This connects a directional measurement to the orthogonal projection used in approximation.[ref]

Ancestors (6)

  1. Inner product
  2. Linear algebra
  3. Algebra
  4. Area of mathematics
  5. Mathematics
  6. Home

Synonyms (2)

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (2)

The dot product, also known as the scalar product, is a mathematical operation that takes two vectors and returns a single scalar (a real number). It is used extensively in geometry, physics, and various fields of engineering.
Dot product by Ciro Santilli 40 Updated 2025-07-16
The definition of the "dot product" of a general space varies quite a lot with different contexts.
Most definitions tend to be bilinear forms.
We use the unqualified generally refers to the dot product of Real coordinate spaces, which is a positive definite symmetric bilinear form. Other important examples include:
The rest of this section is about the case.
The positive definite part of the definition likely comes in because we are so familiar with metric spaces, which requires a positive norm in the norm induced by an inner product.
The default Euclidean space definition, we use the matrix representation of a symmetric bilinear form as the identity matrix, e.g. in :
so that: