Dot-product
   HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used for other symmetric bilinear forms, for example in a
pseudo-Euclidean space In mathematics and theoretical physics, a pseudo-Euclidean space of signature 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 vect ...
. Not to be confused with scalar multiplication.
is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors), and returns a single number. In
Euclidean geometry Euclidean geometry is a mathematical system attributed to ancient Greek mathematics, Greek mathematician Euclid, which he described in his textbook on geometry, ''Euclid's Elements, Elements''. Euclid's approach consists in assuming a small set ...
, the dot product of the
Cartesian coordinates In geometry, a Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of real numbers called ''coordinates'', which are the signed distances to the point from two fixed perpendicular o ...
of two vectors is widely used. It is often called the inner product (or rarely the projection product) of
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
, even though it is not the only inner product that can be defined on Euclidean space (see '' Inner product space'' for more). It should not be confused with the
cross product In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and ...
. 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 In mathematics, sine and cosine are trigonometric functions of an angle. The sine and cosine of an acute angle are defined in the context of a right triangle: for the specified angle, its sine is the ratio of the length of the side opposite that ...
of the angle between them. These definitions are equivalent when using Cartesian coordinates. In modern
geometry Geometry (; ) is a branch of mathematics concerned with properties of space such as the distance, shape, size, and relative position of figures. Geometry is, along with arithmetic, one of the oldest branches of mathematics. A mathematician w ...
,
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
s are often defined by using
vector space In mathematics and physics, a vector space (also called a linear space) is a set (mathematics), set whose elements, often called vector (mathematics and physics), ''vectors'', can be added together and multiplied ("scaled") by numbers called sc ...
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 y^2 = x; in other words, a number whose ''square'' (the result of multiplying the number by itself, or y \cdot y) is . For example, 4 and −4 are square roots of 16 because 4 ...
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 dot operator " ⋅ " 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 with the
vector product In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and ...
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 a
Cartesian coordinate system In geometry, a Cartesian coordinate system (, ) in a plane (geometry), plane is a coordinate system that specifies each point (geometry), point uniquely by a pair of real numbers called ''coordinates'', which are the positive and negative number ...
for Euclidean space. In modern presentations of
Euclidean geometry Euclidean geometry is a mathematical system attributed to ancient Greek mathematics, Greek mathematician Euclid, which he described in his textbook on geometry, ''Euclid's Elements, Elements''. Euclid's approach consists in assuming a small set ...
, the points of space are defined in terms of their
Cartesian coordinates In geometry, a Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of real numbers called ''coordinates'', which are the signed distances to the point from two fixed perpendicular o ...
, and
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
itself is commonly identified with the
real coordinate space In mathematics, the real coordinate space or real coordinate ''n''-space, of dimension , denoted or , is the set of all ordered -tuples of real numbers, that is the set of all sequences of real numbers, also known as '' coordinate vectors''. ...
\mathbf^n. In such a presentation, the notions of length and angle are defined by means of the dot product. The length of a vector is defined as the
square root In mathematics, a square root of a number is a number such that y^2 = x; in other words, a number whose ''square'' (the result of multiplying the number by itself, or y \cdot y) is . For example, 4 and −4 are square roots of 16 because 4 ...
of the dot product of the vector by itself, and the
cosine In mathematics, sine and cosine are trigonometric functions of an angle. The sine and cosine of an acute angle are defined in the context of a right triangle: for the specified angle, its sine is the ratio of the length of the side opposite that ...
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 \mathbf = _1, a_2, \cdots, a_n/math> and specified with respect to an
orthonormal basis In mathematics, particularly linear algebra, an orthonormal basis for an inner product space V with finite Dimension (linear algebra), dimension is a Basis (linear algebra), basis for V whose vectors are orthonormal, that is, they are all unit vec ...
, is defined as: \mathbf a \cdot \mathbf b = \sum_^n a_i b_i = a_1 b_1 + a_2 b_2 + \cdots + a_n b_n where \Sigma denotes
summation In mathematics, summation is the addition of a sequence of numbers, called ''addends'' or ''summands''; the result is their ''sum'' or ''total''. Beside numbers, other types of values can be summed as well: functions, vectors, matrices, pol ...
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 coo ...
of the
vector space In mathematics and physics, a vector space (also called a linear space) is a set (mathematics), set whose elements, often called vector (mathematics and physics), ''vectors'', can be added together and multiplied ("scaled") by numbers called sc ...
. For instance, in
three-dimensional space In geometry, a three-dimensional space (3D space, 3-space or, rarely, tri-dimensional space) is a mathematical space in which three values ('' coordinates'') are required to determine the position of a point. Most commonly, it is the three- ...
, the dot product of vectors and is: \begin \ , 3, -5\cdot , -2, -1&= (1 \times 4) + (3\times-2) + (-5\times-1) \\ &= 4 - 6 + 5 \\ &= 3 \end Likewise, the dot product of the vector with itself is: \begin \ , 3, -5\cdot , 3, -5&= (1 \times 1) + (3\times 3) + (-5\times -5) \\ &= 1 + 9 + 25 \\ &= 35 \end If vectors are identified with column vectors, the dot product can also be written as a matrix product \mathbf a \cdot \mathbf b = \mathbf a^ \mathbf b, where \mathbf a denotes the
transpose In linear algebra, the transpose of a Matrix (mathematics), 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 ...
of \mathbf a. Expressing the above example in this way, a 1 × 3 matrix ( row vector) is multiplied by a 3 × 1 matrix (
column vector In linear algebra, a column vector with elements is an m \times 1 matrix consisting of a single column of 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 , c ...
) to get a 1 × 1 matrix that is identified with its unique entry: \begin 1 & 3 & -5 \end \begin 4 \\ -2 \\ -1 \end = 3 \, .


Geometric definition

In
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
, 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. Euclidean vectors can be added and scal ...
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 \mathbf is denoted by \left\, \mathbf \right\, . The dot product of two Euclidean vectors \mathbf and \mathbf is defined by \mathbf\cdot\mathbf= \left\, \mathbf\right\, \left\, \mathbf\right\, \cos\theta , where \theta is the
angle In Euclidean geometry, an angle can refer to a number of concepts relating to the intersection of two straight Line (geometry), lines at a Point (geometry), point. Formally, an angle is a figure lying in a Euclidean plane, plane formed by two R ...
between \mathbf and \mathbf. In particular, if the vectors \mathbf and \mathbf are
orthogonal In mathematics, orthogonality (mathematics), orthogonality is the generalization of the geometric notion of ''perpendicularity''. Although many authors use the two terms ''perpendicular'' and ''orthogonal'' interchangeably, the term ''perpendic ...
(i.e., their angle is \frac or 90^\circ), then \cos \frac \pi 2 = 0, which implies that \mathbf a \cdot \mathbf b = 0 . At the other extreme, if they are codirectional, then the angle between them is zero with \cos 0 = 1 and \mathbf a \cdot \mathbf b = \left\, \mathbf a \right\, \, \left\, \mathbf b \right\, This implies that the dot product of a vector \mathbf with itself is \mathbf a \cdot \mathbf a = \left\, \mathbf a \right\, ^2 , which gives \left\, \mathbf a \right\, = \sqrt , the formula for the Euclidean length of the vector.


Scalar projection and first properties

The scalar projection (or scalar component) of a Euclidean vector \mathbf in the direction of a Euclidean vector \mathbf is given by a_b = \left\, \mathbf a \right\, \cos \theta , where \theta is the angle between \mathbf and \mathbf. In terms of the geometric definition of the dot product, this can be rewritten as a_b = \mathbf a \cdot \widehat , where \widehat = \mathbf b / \left\, \mathbf b \right\, is the
unit vector In mathematics, a unit vector in a normed vector space is a Vector (mathematics and physics), vector (often a vector (geometry), spatial vector) of Norm (mathematics), length 1. A unit vector is often denoted by a lowercase letter with a circumfle ...
in the direction of \mathbf. The dot product is thus characterized geometrically by \mathbf a \cdot \mathbf b = a_b \left\, \mathbf \right\, = b_a \left\, \mathbf \right\, . The dot product, defined in this manner, is homogeneous under scaling in each variable, meaning that for any scalar \alpha, ( \alpha \mathbf ) \cdot \mathbf b = \alpha ( \mathbf a \cdot \mathbf b ) = \mathbf a \cdot ( \alpha \mathbf b ) . It also satisfies the
distributive law In mathematics, the distributive property of binary operations is a generalization of 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 ...
, meaning that \mathbf a \cdot ( \mathbf b + \mathbf c ) = \mathbf a \cdot \mathbf b + \mathbf a \cdot \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 linea ...
. Moreover, this bilinear form is positive definite, which means that \mathbf a \cdot \mathbf a is never negative, and is zero if and only if \mathbf a = \mathbf 0 , the zero vector.


Equivalence of the definitions

If \mathbf_1,\cdots,\mathbf_n are the standard basis vectors in \mathbf^n, then we may write \begin \mathbf a &= _1 , \dots , a_n= \sum_i a_i \mathbf e_i \\ \mathbf b &= _1 , \dots , b_n= \sum_i b_i \mathbf e_i. \end The vectors \mathbf_i are an
orthonormal basis In mathematics, particularly linear algebra, an orthonormal basis for an inner product space V with finite Dimension (linear algebra), dimension is a Basis (linear algebra), basis for V whose vectors are orthonormal, that is, they are all unit vec ...
, which means that they have unit length and are at right angles to each other. Since these vectors have unit length, \mathbf e_i \cdot \mathbf e_i = 1 and since they form right angles with each other, if i\neq j, \mathbf e_i \cdot \mathbf e_j = 0 . Thus in general, we can say that: \mathbf e_i \cdot \mathbf e_j = \delta_ , where \delta_ is the
Kronecker delta In mathematics, the Kronecker delta (named after Leopold Kronecker) is a function of two variables, usually just non-negative integers. The function is 1 if the variables are equal, and 0 otherwise: \delta_ = \begin 0 &\text i \neq j, \\ 1 &\ ...
. Also, by the geometric definition, for any vector \mathbf_i and a vector \mathbf, we note that \mathbf a \cdot \mathbf e_i = \left\, \mathbf a \right\, \left\, \mathbf e_i \right\, \cos \theta_i = \left\, \mathbf a \right\, \cos \theta_i = a_i , where a_i is the component of vector \mathbf in the direction of \mathbf_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 \mathbf a \cdot \mathbf b = \mathbf a \cdot \sum_i b_i \mathbf e_i = \sum_i b_i ( \mathbf a \cdot \mathbf e_i ) = \sum_i b_i a_i= \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.


Properties

The dot product fulfills the following properties if \mathbf, \mathbf, \mathbf and \mathbf are real vectors and \alpha, \beta, \gamma and \delta are scalars. ;
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. Perhaps most familiar as a pr ...
: \mathbf \cdot \mathbf = \mathbf \cdot \mathbf , which follows from the definition (\theta is the angle between \mathbf and \mathbf): \mathbf \cdot \mathbf = \left\, \mathbf \right\, \left\, \mathbf \right\, \cos \theta = \left\, \mathbf \right\, \left\, \mathbf \right\, \cos \theta = \mathbf \cdot \mathbf . The commutative property can also be easily proven with the algebraic definition, and in more general spaces (where the notion of angle might not be geometrically intuitive but an analogous product can be defined) the angle between two vectors can be defined as \theta = \operatorname\left( \frac \right). ; Bilinear (additive, distributive and scalar-multiplicative in both arguments) : \begin (\alpha \mathbf + \beta\mathbf)&\cdot (\gamma\mathbf+\delta\mathbf) \\ &=\alpha\gamma(\mathbf\cdot\mathbf) + \alpha\delta(\mathbf\cdot\mathbf) +\beta\gamma(\mathbf\cdot\mathbf) +\beta\delta(\mathbf\cdot\mathbf) . \end ; Not
associative In mathematics, the associative property is a property of some binary operations that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement for express ...
: Because the dot product is not defined between a scalar \mathbf\cdot\mathbf and a vector \mathbf, associativity is meaningless. However, bilinearity implies c (\mathbf \cdot \mathbf) = (c\mathbf)\cdot\mathbf = \mathbf\cdot(c\mathbf). This property is sometimes called the "associative law for scalar and dot product", and one may say that "the dot product is associative with respect to scalar multiplication". ;
Orthogonal In mathematics, orthogonality (mathematics), orthogonality is the generalization of the geometric notion of ''perpendicularity''. Although many authors use the two terms ''perpendicular'' and ''orthogonal'' interchangeably, the term ''perpendic ...
: Two non-zero vectors \mathbf and \mathbf are ''orthogonal'' if and only if \mathbf \cdot \mathbf = 0. ; No cancellation : Unlike multiplication of ordinary numbers, where if ab=ac, then b always equals c unless a is zero, the dot product does not obey the cancellation law: If \mathbf\cdot\mathbf=\mathbf\cdot\mathbf and \mathbf\neq\mathbf, then we can write: \mathbf\cdot(\mathbf-\mathbf) = 0 by the
distributive law In mathematics, the distributive property of binary operations is a generalization of 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 ...
; the result above says this just means that \mathbf is perpendicular to (\mathbf-\mathbf), which still allows (\mathbf-\mathbf)\neq\mathbf, and therefore allows \mathbf\neq\mathbf. ; Product rule : If \mathbf and \mathbf are vector-valued differentiable functions, then the derivative ( denoted by a prime ') of \mathbf\cdot\mathbf is given by the rule (\mathbf\cdot\mathbf)' = \mathbf'\cdot\mathbf + \mathbf\cdot\mathbf'.


Application to the law of cosines

Given two vectors and separated by angle \theta (see the upper image), they form a triangle with a third side = - . Let \colora, \colorb and \colorc denote the lengths of , , and , respectively. The dot product of this with itself is: \begin \mathbf \cdot \mathbf & = ( \mathbf - \mathbf) \cdot ( \mathbf - \mathbf ) \\ & = \mathbf \cdot \mathbf - \mathbf \cdot \mathbf - \mathbf \cdot \mathbf + \mathbf \cdot \mathbf \\ & = ^2 - \mathbf \cdot \mathbf - \mathbf \cdot \mathbf + ^2 \\ & = ^2 - 2 \mathbf \cdot \mathbf + ^2 \\ ^2 & = ^2 + ^2 - 2 \cos \mathbf \\ \end which is the
law of cosines In trigonometry, the law of cosines (also known as the cosine formula or cosine rule) relates the lengths of the sides of a triangle to the cosine of one of its angles. For a triangle with sides , , and , opposite respective angles , , and (see ...
.


Triple product

There are two ternary operations involving dot product and
cross product In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and ...
. The scalar triple product of three vectors is defined as \mathbf \cdot ( \mathbf \times \mathbf ) = \mathbf \cdot ( \mathbf \times \mathbf )=\mathbf \cdot ( \mathbf \times \mathbf ). Its value is the
determinant In mathematics, the determinant is a Scalar (mathematics), scalar-valued function (mathematics), function of the entries of a square matrix. The determinant of a matrix is commonly denoted , , or . Its value characterizes some properties of the ...
of the matrix whose columns are the
Cartesian coordinates In geometry, a Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of real numbers called ''coordinates'', which are the signed distances to the point from two fixed perpendicular o ...
of the three vectors. It is the signed
volume Volume is a measure of regions in 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) ...
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. Three equiva ...
defined by the three vectors, and is isomorphic to the three-dimensional special case of the
exterior product In mathematics, specifically in topology, the interior of a subset of a topological space is the union of all subsets of that are open in . A point that is in the interior of is an interior point of . The interior of is the complement of ...
of three vectors. The vector triple product is defined by \mathbf \times ( \mathbf \times \mathbf ) = ( \mathbf \cdot \mathbf )\, \mathbf - ( \mathbf \cdot \mathbf )\, \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 scientific study of matter, its Elementary particle, 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 whi ...
.


Physics

In
physics Physics is the scientific study of matter, its Elementary particle, 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 whi ...
, the dot product takes two vectors and returns a scalar quantity. It is also known as the "scalar product". The dot product of two vectors can be defined as the product of the magnitudes of the two vectors and the cosine of the angle between the two vectors. Thus, \mathbf \cdot \mathbf = , \mathbf, \, , \mathbf, \cos \theta Alternatively, it is defined as the product of the projection of the first vector onto the second vector and the magnitude of the second vector. For example: * Mechanical work is the dot product of
force In physics, a force is an influence that can cause an Physical object, object to change its velocity unless counterbalanced by other forces. In mechanics, force makes ideas like 'pushing' or 'pulling' mathematically precise. Because the Magnitu ...
and
displacement Displacement may refer to: Physical sciences Mathematics and physics *Displacement (geometry), is the difference between the final and initial position of a point trajectory (for instance, the center of mass of a moving object). The actual path ...
vectors, * Power is the dot product of
force In physics, a force is an influence that can cause an Physical object, object to change its velocity unless counterbalanced by other forces. In mechanics, force makes ideas like 'pushing' or 'pulling' mathematically precise. Because the Magnitu ...
and
velocity Velocity is a measurement of speed in a certain direction of motion. It is a fundamental concept in kinematics, the branch of classical mechanics that describes the motion of physical objects. Velocity is a vector (geometry), vector Physical q ...
.


Generalizations


Complex vectors

For vectors with
complex Complex commonly refers to: * Complexity, the behaviour of a system whose components interact in multiple ways so possible interactions are difficult to describe ** Complex system, a system composed of many components which may interact with each ...
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 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 \mathbf \cdot \mathbf = \sum_i , where \overline is the
complex 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 numbers, then the complex conjugate of a + bi is a - ...
of b_i. When vectors are represented by
column vector In linear algebra, a column vector with elements is an m \times 1 matrix consisting of a single column of 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 , c ...
s, the dot product can be expressed as a matrix product involving a conjugate transpose, denoted with the superscript H: \mathbf \cdot \mathbf = \mathbf^\mathsf \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 \mathbf. The dot product is not symmetric, since \mathbf \cdot \mathbf = \overline . The angle between two complex vectors is then given by \cos \theta = \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 map, linear in each of its arguments, but a sesquilinear f ...
s and general inner product spaces, which are widely used in mathematics and
physics Physics is the scientific study of matter, its Elementary particle, 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 whi ...
. The self dot product of a complex vector \mathbf \cdot \mathbf = \mathbf^\mathsf \mathbf , involving the conjugate transpose of a row vector, is also known as the norm squared, \mathbf \cdot \mathbf = \, \mathbf\, ^2, after the Euclidean norm; 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 of
real number In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
s \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 for ...
s \Complex . It is usually denoted using angular brackets by \left\langle \mathbf \, , \mathbf \right\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, 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-n vector u is, then, a function with domain \, and u_i is a notation for the image of i by the function/vector u. This notion can be generalized to square-integrable functions: 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
measure space A measure space is a basic object of measure theory, a branch of mathematics that studies generalized notions of volumes. It contains an underlying set, the subsets of this set that are feasible for measuring (the -algebra) and the method that ...
(X, \mathcal, \mu): \left\langle u , v \right\rangle = \int_X u v \, \text \mu. For example, if f and g are continuous functions over a compact subset K of \mathbb^n with the standard
Lebesgue measure In measure theory, a branch of mathematics, the Lebesgue measure, named after French mathematician Henri Lebesgue, is the standard way of assigning a measure to subsets of higher dimensional Euclidean '-spaces. For lower dimensions or , it c ...
, the above definition becomes: \left\langle f , g \right\rangle = \int_K f(\mathbf) g(\mathbf) \, \operatorname^n \mathbf . Generalized further to complex continuous functions \psi and \chi, by analogy with the complex inner product above, gives: \left\langle \psi, \chi \right\rangle = \int_K \psi(z) \overline \, \text z.


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 \left\langle u , v \right\rangle_r = \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 \mathbf and \mathbf of the same size: \mathbf : \mathbf = \sum_i \sum_j A_ \overline = \operatorname ( \mathbf^\mathsf \mathbf ) = \operatorname ( \mathbf \mathbf^\mathsf ) . And for real matrices, \mathbf : \mathbf = \sum_i \sum_j A_ B_ = \operatorname ( \mathbf^\mathsf \mathbf ) = \operatorname ( \mathbf \mathbf^\mathsf ) = \operatorname ( \mathbf^\mathsf \mathbf ) = \operatorname ( \mathbf \mathbf^\mathsf ) . 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 a
tensor In mathematics, a tensor is an algebraic object that describes a multilinear relationship between sets of algebraic objects associated with a vector space. Tensors may map between different objects such as vectors, scalars, and even other ...
of order n and a tensor of order m is a tensor of order n+m-2, 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 the Kahan summation algorithm are used.


Libraries

A dot product function is included in: * BLAS level 1 real , ; complex , , , * Fortran as or * Julia as   or standard library LinearAlgebra as *
R (programming language) R is a programming language for statistical computing and Data and information visualization, data visualization. It has been widely adopted in the fields of data mining, bioinformatics, data analysis, and data science. The core R language is ...
as for vectors or, more generally for matrices, 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    or   * Python (package NumPy) as    or    or   *
GNU Octave GNU Octave is a scientific programming language for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly ...
as  , and similar code as Matlab * Intel oneAPI Math Kernel Library real p?dot ; complex p?dotc


See also

*
Cauchy–Schwarz inequality The Cauchy–Schwarz inequality (also called Cauchy–Bunyakovsky–Schwarz inequality) is an upper bound on the absolute value of the inner product between two vectors in an inner product space in terms of the product of the vector norms. It is ...
*
Cross product In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and ...
* Dot product representation of a graph * Euclidean norm, the square-root of the self dot product *
Matrix multiplication In mathematics, specifically in linear algebra, matrix multiplication is a binary operation that produces a matrix (mathematics), matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the n ...
*
Metric tensor In the mathematical field of differential geometry, a metric tensor (or simply metric) is an additional structure on a manifold (such as a surface) that allows defining distances and angles, just as the inner product on a Euclidean space allows ...
*
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


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 Open source, open-source collection of Interactive computing, interactive programmes called Demonstrations. It is hosted by Wolfram Research. At its launch, it contained 1300 demonstrations but has grown t ...
, 2007. {{Authority control Articles containing proofs Bilinear forms Operations on vectors Analytic geometry Tensors Scalars