In

^{''n''}. In such a presentation, the notions of length and angles are defined by means of the dot product. The length of a vector is defined as the

_{1}, ..., e_{''n''} are the standard basis vectors in R^{''n''}, then we may write
:$\backslash begin\; \backslash mathbf\; a\; \&=;\; href="/html/ALL/s/\_1\_,\_\backslash dots\_,\_a\_n.html"\; ;"title="\_1\; ,\; \backslash dots\; ,\; a\_n">\_1\; ,\; \backslash dots\; ,\; a\_n$
The vectors e_{''i''} are an _{ ij } is the Kronecker delta.
Also, by the geometric definition, for any vector e_{''i''} and a vector a, we note
:$\backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; e\_i\; =\; \backslash left\backslash ,\; \backslash mathbf\; a\; \backslash right\backslash ,\; \backslash ,\; \backslash left\backslash ,\; \backslash mathbf\; e\_i\; \backslash right\backslash ,\; \backslash cos\; \backslash theta\_i\; =\; \backslash left\backslash ,\; \backslash mathbf\; a\; \backslash right\backslash ,\; \backslash cos\; \backslash theta\_i\; =\; a\_i\; ,$
where ''a''_{''i''} is the component of vector a in the direction of e_{''i''}. The last step in the equality can be seen from the figure.
Now applying the distributivity of the geometric version of the dot product gives
:$\backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; b\; =\; \backslash mathbf\; a\; \backslash cdot\; \backslash sum\_i\; b\_i\; \backslash mathbf\; e\_i\; =\; \backslash sum\_i\; b\_i\; (\; \backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; e\_i\; )\; =\; \backslash sum\_i\; b\_i\; a\_i=\; \backslash sum\_i\; a\_i\; b\_i\; ,$
which is precisely the algebraic definition of the dot product. So the geometric dot product equals the algebraic dot product.

Explanation of dot product including with complex vectors

"Dot Product"

by Bruce Torrence,

mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...

, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space In mathematics and theoretical physics, a pseudo-Euclidean space is a finite- dimensional real -space together with a non- degenerate quadratic form . Such a quadratic form can, given a suitable choice of basis , be applied to a vector , giving
q(x ...

. is an algebraic operation
Algebraic may refer to any subject related to algebra in mathematics and related branches like algebraic number theory and algebraic topology. The word algebra itself has several meanings.
Algebraic may also refer to:
* Algebraic data type, a data ...

that takes two equal-length sequences of numbers (usually coordinate vector
In linear algebra, a coordinate vector is a representation of a vector as an ordered list of numbers (a tuple) that describes the vector in terms of a particular ordered basis. An easy example may be a position such as (5, 2, 1) in a 3-dimensio ...

s), and returns a single number. In Euclidean geometry
Euclidean geometry is a mathematical system attributed to ancient Greek mathematician Euclid, which he described in his textbook on geometry: the '' Elements''. Euclid's approach consists in assuming a small set of intuitively appealing axiom ...

, the dot product of the Cartesian coordinates
A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...

of two vectors is widely used. It is often called the inner product (or rarely projection product) of Euclidean space, even though it is not the only inner product that can be defined on Euclidean space (see Inner product space
In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, often d ...

for more).
Algebraically, the dot product is the sum of the products of the corresponding entries of the two sequences of numbers. Geometrically, it is the product of the Euclidean magnitudes of the two vectors and the cosine of the angle between them. These definitions are equivalent when using Cartesian coordinates. In modern geometry
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space such as the distance, shape, size, and relative position of figures. A mathematician who works in the field of geometry is ca ...

, Euclidean space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean ...

s are often defined by using vector space
In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called '' vectors'', may be added together and multiplied ("scaled") by numbers called '' scalars''. Scalars are often real numbers, but ...

s. In this case, the dot product is used for defining lengths (the length of a vector is the square root
In mathematics, a square root of a number is a number such that ; in other words, a number whose ''square'' (the result of multiplying the number by itself, or ⋅ ) is . For example, 4 and −4 are square roots of 16, because .
E ...

of the dot product of the vector by itself) and angles (the cosine of the angle between two vectors is the quotient of their dot product by the product of their lengths).
The name "dot product" is derived from the centered dot " · " that is often used to designate this operation; the alternative name "scalar product" emphasizes that the result is a scalar, rather than a vector, as is the case for the vector product in three-dimensional space.
Definition

The dot product may be defined algebraically or geometrically. The geometric definition is based on the notions of angle and distance (magnitude) of vectors. The equivalence of these two definitions relies on having aCartesian coordinate system
A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...

for Euclidean space.
In modern presentations of Euclidean geometry
Euclidean geometry is a mathematical system attributed to ancient Greek mathematician Euclid, which he described in his textbook on geometry: the '' Elements''. Euclid's approach consists in assuming a small set of intuitively appealing axiom ...

, the points of space are defined in terms of their Cartesian coordinates
A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...

, and Euclidean space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean ...

itself is commonly identified with the real coordinate space Rsquare root
In mathematics, a square root of a number is a number such that ; in other words, a number whose ''square'' (the result of multiplying the number by itself, or ⋅ ) is . For example, 4 and −4 are square roots of 16, because .
E ...

of the dot product of the vector by itself, and the cosine of the (non oriented) angle between two vectors of length one is defined as their dot product. So the equivalence of the two definitions of the dot product is a part of the equivalence of the classical and the modern formulations of Euclidean geometry.
Coordinate definition

The dot product of two vectors and specified with respect to anorthonormal basis
In mathematics, particularly linear algebra, an orthonormal basis for an inner product space ''V'' with finite dimension is a basis for V whose vectors are orthonormal, that is, they are all unit vectors and orthogonal to each other. For example, ...

, is defined as:
:$\backslash mathbf\backslash cdot\backslash mathbf=\backslash sum\_^n\; \_i\_i=\_1\_1+\_2\_2+\backslash cdots+\_n\_n$
where Σ denotes summation and ''n'' is the dimension
In physics and mathematics, the dimension of a mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any point within it. Thus, a line has a dimension of one (1D) because only one coordi ...

of the vector space
In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called '' vectors'', may be added together and multiplied ("scaled") by numbers called '' scalars''. Scalars are often real numbers, but ...

. For instance, in three-dimensional space
Three-dimensional space (also: 3D space, 3-space or, rarely, tri-dimensional space) is a geometric setting in which three values (called '' parameters'') are required to determine the position of an element (i.e., point). This is the inform ...

, the dot product of vectors and is:
:$\backslash begin\; \backslash \; []\; \backslash cdot\; []\; \&=\; (\; \backslash times\; )\; +\; (\backslash times)\; +\; (\backslash times)\; \backslash \backslash \; \&=\; 4\; -\; 6\; +\; 5\; \backslash \backslash \; \&=\; 3\; \backslash end$
Likewise, the dot product of the vector with itself is:
:$\backslash begin\; \backslash \; []\; \backslash cdot\; []\; \&=\; (\; \backslash times\; )\; +\; (\backslash times)\; +\; (\backslash times)\; \backslash \backslash \; \&=\; 1\; +\; 9\; +\; 25\; \backslash \backslash \; \&=\; 35\; \backslash end$
If vectors are identified with row matrices, the dot product can also be written as a matrix product
In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the ...

:$\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash mathbf\backslash mathbf^\backslash mathsf\; T,$
where $\backslash mathbf^\backslash mathsf\; T$ denotes the transpose
In linear algebra, the transpose of a matrix is an operator which flips a matrix over its diagonal;
that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other notations).
The t ...

of $\backslash mathbf$.
Expressing the above example in this way, a 1 × 3 matrix (row vector
In linear algebra, a column vector with m elements is an m \times 1 matrix consisting of a single column of m entries, for example,
\boldsymbol = \begin x_1 \\ x_2 \\ \vdots \\ x_m \end.
Similarly, a row vector is a 1 \times n matrix for some n, ...

) is multiplied by a 3 × 1 matrix (column vector
In linear algebra, a column vector with m elements is an m \times 1 matrix consisting of a single column of m entries, for example,
\boldsymbol = \begin x_1 \\ x_2 \\ \vdots \\ x_m \end.
Similarly, a row vector is a 1 \times n matrix for some n, ...

) to get a 1 × 1 matrix that is identified with its unique entry:
:$\backslash begin\; \backslash color1\; \&\; \backslash color3\; \&\; \backslash color-5\; \backslash end\; \backslash begin\; \backslash color4\; \backslash \backslash \; \backslash color-2\; \backslash \backslash \; \backslash color-1\; \backslash end\; =\; \backslash color3$.
Geometric definition

InEuclidean space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean ...

, a Euclidean vector
In mathematics, physics, and engineering, a Euclidean vector or simply a vector (sometimes called a geometric vector or spatial vector) is a geometric object that has magnitude (or length) and direction. Vectors can be added to other vectors ...

is a geometric object that possesses both a magnitude and a direction. A vector can be pictured as an arrow. Its magnitude is its length, and its direction is the direction to which the arrow points. The magnitude of a vector a is denoted by $\backslash left\backslash ,\; \backslash mathbf\; \backslash right\backslash ,$. The dot product of two Euclidean vectors a and b is defined by
:$\backslash mathbf\backslash cdot\backslash mathbf=\backslash ,\; \backslash mathbf\backslash ,\; \backslash \; \backslash ,\; \backslash mathbf\backslash ,\; \backslash cos\backslash theta\; ,$
where is the angle
In Euclidean geometry, an angle is the figure formed by two rays, called the '' sides'' of the angle, sharing a common endpoint, called the ''vertex'' of the angle.
Angles formed by two rays lie in the plane that contains the rays. Angles a ...

between and .
In particular, if the vectors and are orthogonal (i.e., their angle is or 90°), then $\backslash cos\; \backslash frac\; \backslash pi\; 2\; =\; 0$, which implies that
:$\backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; b\; =\; 0\; .$
At the other extreme, if they are codirectional, then the angle between them is zero with $\backslash cos\; 0\; =\; 1$ and
:$\backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; b\; =\; \backslash left\backslash ,\; \backslash mathbf\; a\; \backslash right\backslash ,\; \backslash ,\; \backslash left\backslash ,\; \backslash mathbf\; b\; \backslash right\backslash ,$
This implies that the dot product of a vector a with itself is
:$\backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; a\; =\; \backslash left\backslash ,\; \backslash mathbf\; a\; \backslash right\backslash ,\; ^2\; ,$
which gives
: $\backslash left\backslash ,\; \backslash mathbf\; a\; \backslash right\backslash ,\; =\; \backslash sqrt\; ,$
the formula for the Euclidean length of the vector.
Scalar projection and first properties

Thescalar projection
In mathematics, the scalar projection of a vector \mathbf on (or onto) a vector \mathbf, also known as the scalar resolute of \mathbf in the direction of \mathbf, is given by:
:s = \left\, \mathbf\right\, \cos\theta = \mathbf\cdot\mathbf,
whe ...

(or scalar component) of a Euclidean vector a in the direction of a Euclidean vector b is given by
:$a\_b\; =\; \backslash left\backslash ,\; \backslash mathbf\; a\; \backslash right\backslash ,\; \backslash cos\; \backslash theta\; ,$
where is the angle between a and b.
In terms of the geometric definition of the dot product, this can be rewritten
:$a\_b\; =\; \backslash mathbf\; a\; \backslash cdot\; \backslash widehat\; ,$
where $\backslash widehat\; =\; \backslash mathbf\; b\; /\; \backslash left\backslash ,\; \backslash mathbf\; b\; \backslash right\backslash ,$ is the unit vector
In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) of length 1. A unit vector is often denoted by a lowercase letter with a circumflex, or "hat", as in \hat (pronounced "v-hat").
The term ''direction vec ...

in the direction of b.
The dot product is thus characterized geometrically by
:$\backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; b\; =\; a\_b\; \backslash left\backslash ,\; \backslash mathbf\; \backslash right\backslash ,\; =\; b\_a\; \backslash left\backslash ,\; \backslash mathbf\; \backslash right\backslash ,\; .$
The dot product, defined in this manner, is homogeneous under scaling in each variable, meaning that for any scalar ''α'',
:$(\; \backslash alpha\; \backslash mathbf\; )\; \backslash cdot\; \backslash mathbf\; b\; =\; \backslash alpha\; (\; \backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; b\; )\; =\; \backslash mathbf\; a\; \backslash cdot\; (\; \backslash alpha\; \backslash mathbf\; b\; )\; .$
It also satisfies a distributive law
In mathematics, the distributive property of binary operations generalizes the distributive law, which asserts that the equality
x \cdot (y + z) = x \cdot y + x \cdot z
is always true in elementary algebra.
For example, in elementary arithmetic, ...

, meaning that
:$\backslash mathbf\; a\; \backslash cdot\; (\; \backslash mathbf\; b\; +\; \backslash mathbf\; c\; )\; =\; \backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; b\; +\; \backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; c\; .$
These properties may be summarized by saying that the dot product is a bilinear form
In mathematics, a bilinear form is a bilinear map on a vector space (the elements of which are called '' vectors'') over a field ''K'' (the elements of which are called '' scalars''). In other words, a bilinear form is a function that is linear ...

. Moreover, this bilinear form is positive definite, which means that
$\backslash mathbf\; a\; \backslash cdot\; \backslash mathbf\; a$
is never negative, and is zero if and only if $\backslash mathbf\; a\; =\; \backslash mathbf\; 0$—the zero vector.
The dot product is thus equivalent to multiplying the norm (length) of b by the norm of the projection of a over b.
Equivalence of the definitions

If eorthonormal basis
In mathematics, particularly linear algebra, an orthonormal basis for an inner product space ''V'' with finite dimension is a basis for V whose vectors are orthonormal, that is, they are all unit vectors and orthogonal to each other. For example, ...

, which means that they have unit length and are at right angles to each other. Hence since these vectors have unit length
:$\backslash mathbf\; e\_i\; \backslash cdot\; \backslash mathbf\; e\_i\; =\; 1$
and since they form right angles with each other, if ,
:$\backslash mathbf\; e\_i\; \backslash cdot\; \backslash mathbf\; e\_j\; =\; 0\; .$
Thus in general, we can say that:
:$\backslash mathbf\; e\_i\; \backslash cdot\; \backslash mathbf\; e\_j\; =\; \backslash delta\_\; .$
Where δ Properties

The dot product fulfills the following properties if a, b, and c are real vectors and ''r'' is a scalar. #Commutative
In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Most familiar as the name of ...

:
#: $\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; ,$
#: which follows from the definition (''θ'' is the angle between a and b):
#: $\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash left\backslash ,\; \backslash mathbf\; \backslash right\backslash ,\; \backslash left\backslash ,\; \backslash mathbf\; \backslash right\backslash ,\; \backslash cos\; \backslash theta\; =\; \backslash left\backslash ,\; \backslash mathbf\; \backslash right\backslash ,\; \backslash left\backslash ,\; \backslash mathbf\; \backslash right\backslash ,\; \backslash cos\; \backslash theta\; =\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; .$
# Distributive over vector addition:
#: $\backslash mathbf\; \backslash cdot\; (\backslash mathbf\; +\; \backslash mathbf)\; =\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; +\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; .$
# Bilinear:
#: $\backslash mathbf\; \backslash cdot\; (\; r\; \backslash mathbf\; +\; \backslash mathbf\; )\; =\; r\; (\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; )\; +\; (\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; )\; .$
# Scalar multiplication
In mathematics, scalar multiplication is one of the basic operations defining a vector space in linear algebra (or more generally, a module in abstract algebra). In common geometrical contexts, scalar multiplication of a real Euclidean vector ...

:
#: $(\; c\_1\; \backslash mathbf\; )\; \backslash cdot\; (\; c\_2\; \backslash mathbf\; )\; =\; c\_1\; c\_2\; (\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; )\; .$
# Not associative
In mathematics, the associative property is a property of some binary operations, which means that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement ...

because the dot product between a scalar (a ⋅ b) and a vector (c) is not defined, which means that the expressions involved in the associative property, (a ⋅ b) ⋅ c or a ⋅ (b ⋅ c) are both ill-defined. Note however that the previously mentioned scalar multiplication property is sometimes called the "associative law for scalar and dot product" or one can say that "the dot product is associative with respect to scalar multiplication" because ''c'' (a ⋅ b) = (''c'' a) ⋅ b = a ⋅ (''c'' b).
# Orthogonal:
#: Two non-zero vectors a and b are ''orthogonal'' if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (shortened as "iff") is a biconditional logical connective between statements, where either both statements are true or both are false.
The connective is bico ...

.
# No cancellation:
#: Unlike multiplication of ordinary numbers, where if , then ''b'' always equals ''c'' unless ''a'' is zero, the dot product does not obey the cancellation law:
#: If and , then we can write: by the distributive law
In mathematics, the distributive property of binary operations generalizes the distributive law, which asserts that the equality
x \cdot (y + z) = x \cdot y + x \cdot z
is always true in elementary algebra.
For example, in elementary arithmetic, ...

; the result above says this just means that a is perpendicular to , which still allows , and therefore allows .
# Product rule
In calculus, the product rule (or Leibniz rule or Leibniz product rule) is a formula used to find the derivatives of products of two or more functions. For two functions, it may be stated in Lagrange's notation as (u \cdot v)' = u ' \cdot v ...

:
#: If a and b are (vector-valued) differentiable functions, then the derivative ( denoted by a prime ) of is given by the rule .
Application to the law of cosines

Given two vectors a and b separated by angle ''θ'' (see image right), they form a triangle with a third side . The dot product of this with itself is: :$\backslash begin\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; \&\; =\; (\; \backslash mathbf\; -\; \backslash mathbf)\; \backslash cdot\; (\; \backslash mathbf\; -\; \backslash mathbf\; )\; \backslash \backslash \; \&\; =\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; -\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; -\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; +\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; \backslash \backslash \; \&\; =\; \backslash mathbf^2\; -\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; -\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; +\; \backslash mathbf^2\; \backslash \backslash \; \&\; =\; \backslash mathbf^2\; -\; 2\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; +\; \backslash mathbf^2\; \backslash \backslash \; \backslash mathbf^2\; \&\; =\; \backslash mathbf^2\; +\; \backslash mathbf^2\; -\; 2\; \backslash mathbf\; \backslash mathbf\; \backslash cos\; \backslash mathbf\; \backslash \backslash \; \backslash end$ which is thelaw of cosines
In trigonometry, the law of cosines (also known as the cosine formula, cosine rule, or al-Kashi's theorem) relates the lengths of the sides of a triangle to the cosine of one of its angles. Using notation as in Fig. 1, the law of cosines stat ...

.
Triple product

There are two ternary operations involving dot product and cross product. The scalar triple product of three vectors is defined as :$\backslash mathbf\; \backslash cdot\; (\; \backslash mathbf\; \backslash times\; \backslash mathbf\; )\; =\; \backslash mathbf\; \backslash cdot\; (\; \backslash mathbf\; \backslash times\; \backslash mathbf\; )=\backslash mathbf\; \backslash cdot\; (\; \backslash mathbf\; \backslash times\; \backslash mathbf\; ).$ Its value is thedeterminant
In mathematics, the determinant is a scalar value that is a function of the entries of a square matrix. It characterizes some properties of the matrix and the linear map represented by the matrix. In particular, the determinant is nonzero if an ...

of the matrix whose columns are the Cartesian coordinates
A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...

of the three vectors. It is the signed volume
Volume is a measure of occupied three-dimensional space. It is often quantified numerically using SI derived units (such as the cubic metre and litre) or by various imperial or US customary units (such as the gallon, quart, cubic inch). The de ...

of the parallelepiped
In geometry, a parallelepiped is a three-dimensional figure formed by six parallelograms (the term ''rhomboid'' is also sometimes used with this meaning). By analogy, it relates to a parallelogram just as a cube relates to a square. In Euclidea ...

defined by the three vectors, and is isomorphic to the three-dimensional special case of the exterior product of three vectors.
The vector triple product is defined by
:$\backslash mathbf\; \backslash times\; (\; \backslash mathbf\; \backslash times\; \backslash mathbf\; )\; =\; (\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; )\backslash ,\; \backslash mathbf\; -\; (\; \backslash mathbf\; \backslash cdot\; \backslash mathbf\; )\backslash ,\; \backslash mathbf\; .$
This identity, also known as ''Lagrange's formula'', may be remembered as "ACB minus ABC", keeping in mind which vectors are dotted together. This formula has applications in simplifying vector calculations in physics
Physics is the natural science that studies matter, its fundamental constituents, its motion and behavior through space and time, and the related entities of energy and force. "Physical science is that department of knowledge which rela ...

.
Physics

Inphysics
Physics is the natural science that studies matter, its fundamental constituents, its motion and behavior through space and time, and the related entities of energy and force. "Physical science is that department of knowledge which rela ...

, vector magnitude is a scalar in the physical sense (i.e., a physical quantity
A physical quantity is a physical property of a material or system that can be quantified by measurement. A physical quantity can be expressed as a ''value'', which is the algebraic multiplication of a ' Numerical value ' and a ' Unit '. For exam ...

independent of the coordinate system), expressed as the product of a numerical value and a physical unit, not just a number. The dot product is also a scalar in this sense, given by the formula, independent of the coordinate system. For example:
* Mechanical work
In physics, work is the energy transferred to or from an object via the application of force along a displacement. In its simplest form, for a constant force aligned with the direction of motion, the work equals the product of the force stre ...

is the dot product of force
In physics, a force is an influence that can change the motion of an object. A force can cause an object with mass to change its velocity (e.g. moving from a state of rest), i.e., to accelerate. Force can also be described intuitively as ...

and displacement vectors,
* Power is the dot product of force
In physics, a force is an influence that can change the motion of an object. A force can cause an object with mass to change its velocity (e.g. moving from a state of rest), i.e., to accelerate. Force can also be described intuitively as ...

and velocity
Velocity is the directional speed of an object in motion as an indication of its rate of change in position as observed from a particular frame of reference and as measured by a particular standard of time (e.g. northbound). Velocity i ...

.
Generalizations

Complex vectors

For vectors with complex entries, using the given definition of the dot product would lead to quite different properties. For instance, the dot product of a vector with itself could be zero without the vector being the zero vector (e.g. this would happen with the vector a = i. This in turn would have consequences for notions like length and angle. Properties such as the positive-definite norm can be salvaged at the cost of giving up the symmetric and bilinear properties of the dot product, through the alternative definition :$\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash sum\_i\; ,$ where $\backslash overline$ is thecomplex conjugate
In mathematics, the complex conjugate of a complex number is the number with an equal real part and an imaginary part equal in magnitude but opposite in sign. That is, (if a and b are real, then) the complex conjugate of a + bi is equal to a - ...

of $b\_i$. When vectors are represented by column vector
In linear algebra, a column vector with m elements is an m \times 1 matrix consisting of a single column of m entries, for example,
\boldsymbol = \begin x_1 \\ x_2 \\ \vdots \\ x_m \end.
Similarly, a row vector is a 1 \times n matrix for some n, ...

s, the dot product can be expressed as a matrix product
In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the ...

involving a conjugate transpose
In mathematics, the conjugate transpose, also known as the Hermitian transpose, of an m \times n complex matrix \boldsymbol is an n \times m matrix obtained by transposing \boldsymbol and applying complex conjugate on each entry (the complex co ...

, denoted with the superscript H:
:$\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash mathbf^\backslash mathsf\; \backslash mathbf\; .$
In the case of vectors with real components, this definition is the same as in the real case. The dot product of any vector with itself is a non-negative real number, and it is nonzero except for the zero vector. However, the complex dot product is sesquilinear rather than bilinear, as it is conjugate linear and not linear in a. The dot product is not symmetric, since
:$\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash overline\; .$
The angle between two complex vectors is then given by
:$\backslash cos\; \backslash theta\; =\; \backslash frac\; .$
The complex dot product leads to the notions of Hermitian form
In mathematics, a sesquilinear form is a generalization of a bilinear form that, in turn, is a generalization of the concept of the dot product of Euclidean space. A bilinear form is linear in each of its arguments, but a sesquilinear form allows ...

s and general inner product space
In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, often d ...

s, which are widely used in mathematics and physics
Physics is the natural science that studies matter, its fundamental constituents, its motion and behavior through space and time, and the related entities of energy and force. "Physical science is that department of knowledge which rela ...

.
The self dot product of a complex vector $\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash mathbf^\backslash mathsf\; \backslash mathbf$, involving the conjugate transpose of a row vector, is also known as the norm squared, $\backslash mathbf\; \backslash cdot\; \backslash mathbf\; =\; \backslash ,\; \backslash mathbf\backslash ,\; ^2$, after the Euclidean norm
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean s ...

; it is a vector generalization of the '' absolute square'' of a complex scalar (see also: squared Euclidean distance).
Inner product

The inner product generalizes the dot product to abstract vector spaces over a field of scalars, being either the field ofreal number
In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every ...

s $\backslash R$ or the field of complex number
In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form ...

s $\backslash Complex$. It is usually denoted using angular brackets by $\backslash left\backslash langle\; \backslash mathbf\; \backslash ,\; ,\; \backslash mathbf\; \backslash right\backslash rangle$.
The inner product of two vectors over the field of complex numbers is, in general, a complex number, and is sesquilinear instead of bilinear. An inner product space is a normed vector space
In mathematics, a normed vector space or normed space is a vector space over the real or complex numbers, on which a norm is defined. A norm is the formalization and the generalization to real vector spaces of the intuitive notion of "length" ...

, and the inner product of a vector with itself is real and positive-definite.
Functions

The dot product is defined for vectors that have a finite number of entries. Thus these vectors can be regarded as discrete functions: a length- vector is, then, a function with domain , and is a notation for the image of by the function/vector . This notion can be generalized tocontinuous function
In mathematics, a continuous function is a function such that a continuous variation (that is a change without jump) of the argument induces a continuous variation of the value of the function. This means that there are no abrupt changes in va ...

s: just as the inner product on vectors uses a sum over corresponding components, the inner product on functions is defined as an integral over some interval (also denoted ):
:$\backslash left\backslash langle\; u\; ,\; v\; \backslash right\backslash rangle\; =\; \backslash int\_a^b\; u(x)\; v(x)\; d\; x$
Generalized further to complex function
Complex analysis, traditionally known as the theory of functions of a complex variable, is the branch of mathematical analysis that investigates functions of complex numbers. It is helpful in many branches of mathematics, including algebraic ...

s and , by analogy with the complex inner product above, gives
:$\backslash left\backslash langle\; \backslash psi\; ,\; \backslash chi\; \backslash right\backslash rangle\; =\; \backslash int\_a^b\; \backslash psi(x)\; \backslash overline\; d\; x\; .$
Weight function

Inner products can have a weight function (i.e., a function which weights each term of the inner product with a value). Explicitly, the inner product of functions $u(x)$ and $v(x)$ with respect to the weight function $r(x)>0$ is :$\backslash left\backslash langle\; u\; ,\; v\; \backslash right\backslash rangle\; =\; \backslash int\_a^b\; r(x)\; u(x)\; v(x)\; d\; x.$Dyadics and matrices

A double-dot product for matrices is the Frobenius inner product, which is analogous to the dot product on vectors. It is defined as the sum of the products of the corresponding components of two matrices A and B of the same size: :$\backslash mathbf\; :\; \backslash mathbf\; =\; \backslash sum\_i\; \backslash sum\_j\; A\_\; \backslash overline\; =\; \backslash operatorname\; (\; \backslash mathbf^\backslash mathsf\; \backslash mathbf\; )\; =\; \backslash operatorname\; (\; \backslash mathbf\; \backslash mathbf^\backslash mathsf\; )\; .$ :$\backslash mathbf\; :\; \backslash mathbf\; =\; \backslash sum\_i\; \backslash sum\_j\; A\_\; B\_\; =\; \backslash operatorname\; (\; \backslash mathbf^\backslash mathsf\; \backslash mathbf\; )\; =\; \backslash operatorname\; (\; \backslash mathbf\; \backslash mathbf^\backslash mathsf\; )\; =\; \backslash operatorname\; (\; \backslash mathbf^\backslash mathsf\; \backslash mathbf\; )\; =\; \backslash operatorname\; (\; \backslash mathbf\; \backslash mathbf^\backslash mathsf\; )\; .$ (For real matrices) Writing a matrix as a dyadic, we can define a different double-dot product (see ,) however it is not an inner product.Tensors

The inner product between atensor
In mathematics, a tensor is an algebraic object that describes a multilinear relationship between sets of algebraic objects related to a vector space. Tensors may map between different objects such as vectors, scalars, and even other tens ...

of order ''n'' and a tensor of order ''m'' is a tensor of order , see Tensor contraction for details.
Computation

Algorithms

The straightforward algorithm for calculating a floating-point dot product of vectors can suffer from catastrophic cancellation. To avoid this, approaches such as theKahan summation algorithm In numerical analysis, the Kahan summation algorithm, also known as compensated summation, significantly reduces the numerical error in the total obtained by adding a sequence of finite- precision floating-point numbers, compared to the obvious app ...

are used.
Libraries

A dot product function is included in: *BLAS
Basic Linear Algebra Subprograms (BLAS) is a specification that prescribes a set of low-level routines for performing common linear algebra operations such as vector addition, scalar multiplication, dot products, linear combinations, and matri ...

level 1 real SDOT, DDOT; complex CDOTU, ZDOTU = X^T * Y, CDOTC ZDOTC = X^H * Y
* Julia as
* Matlab
MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...

as or or
* GNU Octave as
* Intel oneAPI Math Kernel Library real p?dot dot = sub(x)'*sub(y); complex p?dotc dotc = conjg(sub(x)')*sub(y)
See also

*Cauchy–Schwarz inequality
The Cauchy–Schwarz inequality (also called Cauchy–Bunyakovsky–Schwarz inequality) is considered one of the most important and widely used inequalities in mathematics.
The inequality for sums was published by . The corresponding inequality fo ...

* Cross product
* Dot product representation of a graph
* Euclidean norm
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean s ...

, the square-root of the self dot product
* Matrix multiplication
* Metric tensor
* Multiplication of vectors In mathematics, vector multiplication may refer to one of several operations between two (or more) vectors. It may concern any of the following articles:
* Dot product – also known as the "scalar product", a binary operation that takes two vector ...

* Outer product
In linear algebra, the outer product of two coordinate vectors is a matrix. If the two vectors have dimensions ''n'' and ''m'', then their outer product is an ''n'' × ''m'' matrix. More generally, given two tensors (multidimensional arrays of n ...

Notes

References

External links

*Explanation of dot product including with complex vectors

"Dot Product"

by Bruce Torrence,

Wolfram Demonstrations Project
The Wolfram Demonstrations Project is an organized, open-source collection of small (or medium-size) interactive programs called Demonstrations, which are meant to visually and interactively represent ideas from a range of fields. It is hos ...

, 2007.
{{tensors
Articles containing proofs
Bilinear forms
Operations on vectors
Analytic geometry
Tensors
Scalars