All Topics  
Dot product

 
Dot Product

   Email Print
   Bookmark   Link






 

Dot product



 
 
In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, the dot product, also known as the scalar product, is an operation which takes two vectors over the real numbers R and returns a real-valued scalar
Scalar (mathematics)

In linear algebra, real numbers are called scalars and relate to vectors in a vector space through the operation of scalar multiplication, in which a vector can be multiplied by a number to produce another vector....
 quantity. It is the standard inner product
Inner product space

In mathematics, an inner product space is a vector space with the additional Mathematical structure of inner product. This additional structure associates each pair of vectors in the space with a Scalar quantity known as the inner product of the vectors....
 of the orthonormal Euclidean space
Euclidean space

Around 300 Before Christ, the Ancient Greece mathematician Euclid undertook a study of relationships among distances and angles, first in a plane and then in space....
.

dot product of two vectors a = [a1, a2, … , an] and b = [b1, b2, … , bn] is defined as: where S denotes summation notation
Summation

Summation is the addition of a set of numbers; the result is their sum or total. An interim or present total of a summation process is termed the running total....
 and n is the dimension of the vectors.

For example, the dot product of two three-dimensional vectors <1, 3, -5> and <4, -2, -1> is

For two complex
Complex number

In mathematics, the complex numbers are an extension of the real numbers obtained by adjoining an imaginary unit, denoted i, which satisfies:...
 column vectors the dot product is defined as where is the complex conjugate
Complex conjugate

In mathematics, the complex conjugate of a complex number is given by changing the sign of the imaginary part. Thus, the conjugate of the complex number...
 of '; further note that in the complex case

The dot product is typically applied to vectors from orthonormal vector space
Vector space

File:Vector addition ans scaling.pngA vector space is a mathematical structure formed by a collection of vectors: objects that may be Vector addition together and Scalar multiplication by numbers, called scalar s in this context....
s.






Discussion
Ask a question about 'Dot product'
Start a new discussion about 'Dot product'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, the dot product, also known as the scalar product, is an operation which takes two vectors over the real numbers R and returns a real-valued scalar
Scalar (mathematics)

In linear algebra, real numbers are called scalars and relate to vectors in a vector space through the operation of scalar multiplication, in which a vector can be multiplied by a number to produce another vector....
 quantity. It is the standard inner product
Inner product space

In mathematics, an inner product space is a vector space with the additional Mathematical structure of inner product. This additional structure associates each pair of vectors in the space with a Scalar quantity known as the inner product of the vectors....
 of the orthonormal Euclidean space
Euclidean space

Around 300 Before Christ, the Ancient Greece mathematician Euclid undertook a study of relationships among distances and angles, first in a plane and then in space....
.

Definition

The dot product of two vectors a = [a1, a2, … , an] and b = [b1, b2, … , bn] is defined as: where S denotes summation notation
Summation

Summation is the addition of a set of numbers; the result is their sum or total. An interim or present total of a summation process is termed the running total....
 and n is the dimension of the vectors.

For example, the dot product of two three-dimensional vectors <1, 3, -5> and <4, -2, -1> is

For two complex
Complex number

In mathematics, the complex numbers are an extension of the real numbers obtained by adjoining an imaginary unit, denoted i, which satisfies:...
 column vectors the dot product is defined as where is the complex conjugate
Complex conjugate

In mathematics, the complex conjugate of a complex number is given by changing the sign of the imaginary part. Thus, the conjugate of the complex number...
 of '; further note that in the complex case

The dot product is typically applied to vectors from orthonormal vector space
Vector space

File:Vector addition ans scaling.pngA vector space is a mathematical structure formed by a collection of vectors: objects that may be Vector addition together and Scalar multiplication by numbers, called scalar s in this context....
s. Its generalization to non-orthonormal vector spaces is described below
Dot product

In mathematics, the dot product, also known as the scalar product, is an operation which takes two vector over the real numbers R and returns a real-valued scalar quantity....
.

Conversion to matrix multiplication

Using matrix multiplication
Matrix multiplication

In mathematics, matrix multiplication is the operation of multiplying a matrix with either a scalar or another matrix. This article gives an overview of the various ways to perform matrix multiplication....
 and treating the vectors as n×1 matrices (i.e. "column matrices" or "column vectors"), the dot product can also be written as:

where aT denotes the transpose
Transpose

In linear algebra, the transpose of a matrix A is another matrix AT created by any one of the following equivalent actions:...
 of the matrix a, and in this specific case, since a is a column matrix, the transpose of a is a "row matrix" or "row vector" (1×n matrix).

For instance, the dot product of the two above-mentioned three-dimensional vectors is equivalent to the product of a 1×3 matrix by a 3×1 matrix (which, by virtue of the matrix multiplication, results in a 1×1 matrix, i.e., a scalar):

Geometric interpretation


In Euclidean geometry, the dot product, length, and angle
Angle

In geometry and trigonometry, an angle is the figure formed by two Ray sharing a common endpoint, called the vertex of the angle . The magnitude of the angle is the "amount of rotation" that separates the two rays, and can be measured by considering the length of circular arc swept out when one ray is rotated about the vertex to coincide...
 are related. For a vector a, the dot product a · a is the square of the length of a, or

where |a| denotes the length (magnitude) of a. More generally, if b is another vector

where
|a| and |b| denote the length of a and b
? is the angle
Angle

In geometry and trigonometry, an angle is the figure formed by two Ray sharing a common endpoint, called the vertex of the angle . The magnitude of the angle is the "amount of rotation" that separates the two rays, and can be measured by considering the length of circular arc swept out when one ray is rotated about the vertex to coincide...
 between them.


Thus, given two vectors, the angle between them can be found by rearranging the above formula:



As the cosine of 90° is zero, the dot product of two orthogonal vectors is always zero:

Moreover, two vectors can be considered orthogonal if and only if their dot product is zero, and they have non-null length. This property provides a simple method to test the condition of orthogonality.

Sometimes these properties are also used for defining the dot product, especially in 2 and 3 dimensions; this definition is equivalent to the above one. For higher dimensions the formula can be used to define the concept of angle.

The geometric properties rely on the basis
Basis (linear algebra)

In linear algebra, a basis is a set of vectors that, in a linear combination, can represent every vector in a given vector space or free module, and such that no element of the set can be represented as a linear combination of the others....
 being orthonormal, i.e. composed of vectors perpendicular to each other and having unit length.

Scalar projection

If both a and b have length one (i.e. they are unit vector
Unit vector

In mathematics, a unit vector in a normed vector space is a Vector space whose Norm is 1 . A unit vector is often denoted by a lowercase letter with a superscribed caret or ?hat?, like this: ....
s), their dot product simply gives the cosine of the angle between them.

If only b is a unit vector
Unit vector

In mathematics, a unit vector in a normed vector space is a Vector space whose Norm is 1 . A unit vector is often denoted by a lowercase letter with a superscribed caret or ?hat?, like this: ....
, then the dot product a · b gives |a| cos(?), i.e. the magnitude of the projection of a in the direction of b, with a minus sign if the direction is opposite. This is called the scalar projection
Scalar resolute

The scalar resolute, also known as the scalar projection or scalar component, of a vector in the direction of a vector is given by:...
 of a onto b, or scalar component of a in the direction of b (see figure). This property of the dot product has several useful applications (for instance, see next section).

If neither a nor b is a unit vector, then the magnitude of the projection of a in the direction of b, for example, would be a · (b / |b|) as the unit vector in the direction of b is b / |b|.

Rotation

A rotation
Rotation (mathematics)

In geometry and linear algebra, a rotation is a transformation in a plane or in space that describes the motion of a rigid body around a fixed point....
 of the orthonormal basis in terms of which vector a is represented is obtained with a multiplication of a by a rotation matrix
Rotation matrix

In matrix theory, a rotation matrix is a real number square matrix whose transpose is its invertible matrix and whose determinant is 1 The matrix is so-called because it geometrically corresponds to a linear map that sends vectors to a corresponding vector rotated about the origin by a fixed angle....
 R. This matrix multiplication
Matrix multiplication

In mathematics, matrix multiplication is the operation of multiplying a matrix with either a scalar or another matrix. This article gives an overview of the various ways to perform matrix multiplication....
 is just a compact representation of a sequence of dot products.

For instance, let
  • B1 = and B2 = be two different orthonormal bases
    Orthonormal basis

    In mathematics, an orthonormal basis of an inner product space V , is a set of mutually orthogonality vectors of magnitude 1 that span the space when infinite linear combinations are allowed....
     of the same space R3, with B2 obtained by just rotating B1,
  • a1 = (ax, ay, az) represent vector a in terms of B1,
  • a2 = (au, av, aw) represent the same vector in terms of the rotated basis B2,
  • u1, v1, w1 be the rotated basis vectors u, v, w represented in terms of B1.
Then the rotation from B1 to B2 is performed as follows:

Notice that the rotation matrix R is assembled by using the rotated basis vectors u1, v1, w1 as its rows, and these vectors are unit vectors. By definition, Ra1 consists of a sequence of dot products between each of the three rows of R and vector a1. Each of these dot products determines a scalar component of a in the direction of a rotated basis vector (see previous section).

If a1 is a row vector
Row vector

In linear algebra, a row vector or row matrix is a 1 × n matrix , that is, a matrix consisting of a single row:The transpose of a row vector is a column vector:...
, rather than a column vector
Column vector

In linear algebra, a column vector or column matrix is an m × 1 matrix , i.e. a matrix consisting of a single column of elements....
, then R must contain the rotated basis vectors in its columns, and must post-multiply a1:

The dot product in physics


In physics
Physics

Physics is the natural science which examines basic concepts such as energy, force, and spacetime and all that derives from these, such as mass, charge, matter and its Motion ....
, magnitude is a scalar
Scalar (physics)

In physics, a scalar is a simple physical quantity that is not changed by coordinate system rotations or translations , or by Lorentz transformations or space-time translations ....
 in the physical sense, i.e. a physical quantity
Physical quantity

A physical quantity is a physical property that can be Quantitative. This means it can be measured and/or calculated and expressed in numbers. For example, "weight" is a physical quantity that can be expressed by stating a number of some basic measurement unit such as pound or kilograms, while "beauty" is a property that is difficult to desc...
 independent of the coordinate system, expressed as the product
Product (mathematics)

In the a mathematics, a product is the result of Multiplication, or an expression that identifies divisors to be multiplied. The order in real number or complex number numbers are multiplied has no bearing on the product; this is known as the Commutativity of multiplication....
  of a numerical value
Number

A number is a mathematical object used in counting and measurement. A notational symbol which represents a number is called a Numeral system, but in common usage the word number is used for both the abstract object and the symbol, as well as for the numeral for the number....
 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. The formula in terms of coordinates is evaluated with not just numbers, but numbers times units. Therefore, although it relies on the basis being orthonormal, it does not depend on scaling.

Example:
  • Mechanical work
    Mechanical work

    In physics, mechanical work is the amount of energy transferred by a force acting through a distance. Like energy, it is a scalar quantity, with SI of joules....
     is the dot product of force
    Force

    In physics, a force is that which can cause an object with mass to change its velocity. Force has both Euclidean_vector#Length of a vector and Direction , making it a Vector quantity....
     and displacement
    Displacement (vector)

    In physics, displacement is the vector that specifies the change in position of a point or a particle in reference to a previous position. When the previous point is the origin, this is better referred to as a position vector....


Properties

The following properties hold if a, b, and c are real vectors and r is a scalar
Scalar (mathematics)

In linear algebra, real numbers are called scalars and relate to vectors in a vector space through the operation of scalar multiplication, in which a vector can be multiplied by a number to produce another vector....
.

The dot product is commutative:

The dot product is distributive over vector addition:

The dot product is not associative, but (for column vectors a, b, and c) with the help of the matrix-multiplication one can derive:

The dot product is bilinear
Bilinear form

In mathematics, a bilinear form on a vector space V is a bilinear mapping V ? V ? F, where F is the field of scalars....
:

When multiplied by a scalar value, dot product satisfies: (these last two properties follow from the first two).

Two non-zero vectors a and b are perpendicular
Perpendicular

In geometry, two line or plane , are considered perpendicular to each other if they form congruence adjacent angles angles . The term may be used as a noun or adjective....
 if and only if
If and only if

If and only if, in logic and fields that rely on it such as mathematics and philosophy, is a biconditional logical connective between statements....
 ab = 0.

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 ab = ac and a ? 0:
then we can write: a • (b - c) = 0 by the distributive law; and from the previous result above:
If a is perpendicular to (b - c), we can have (b - c) ? 0 and therefore b ? c.


Provided that the basis is orthonormal, the dot product is invariant under isometric changes of the basis: rotations, reflections, and combinations, keeping the origin fixed. The above mentioned geometric interpretation relies on this property. In other words, for an orthonormal space with any number of dimensions, the dot product is invariant under a coordinate transformation
Coordinate transformation

See:*Coordinate system#Transformations*List of canonical coordinate transformations*Coordinate rotation*Covariance and contravariance*Covariant transformation...
 based on an orthogonal matrix
Orthogonal matrix

In matrix theory, a real number orthogonal matrix is a Matrix #Square matrices Q whose transpose is its inverse matrix:A special orthogonal matrix is an orthogonal matrix with determinant +1:...
. This corresponds to the following two conditions:
  • the new basis is again orthonormal (i.e., it is orthonormal expressed in the old one)
  • the new base vectors have the same length as the old ones (i.e., unit length in terms of the old basis)


Derivative

If a and b are functions, then the derivative of ab is a' • b + ab'

Triple product expansion


This is a very useful identity (also known as Lagrange's formula) involving the dot- and cross-
Cross product

In mathematics, the cross product is a binary operation on two vector s in a three-dimensional Euclidean space that results in another vector which is orthogonal to the plane containing the two input vectors....
products. It is written as

which is easier to remember as “BAC minus CAB”, keeping in mind which vectors are dotted together. This formula is commonly used to simplify vector calculations in physics
Physics

Physics is the natural science which examines basic concepts such as energy, force, and spacetime and all that derives from these, such as mass, charge, matter and its Motion ....
.

Proof of the geometric interpretation

Note: This proof is shown for 3-dimensional vectors, but is readily extendable to n-dimensional vectors.

Consider a vector Repeated application of the Pythagorean theorem
Pythagorean theorem

In mathematics, the Pythagorean theorem or Pythagoras' theorem is a relation in Euclidean geometry among the three sides of a triangle#Types of triangles....
 yields for its length v But this is the same as so we conclude that taking the dot product of a vector v with itself yields the squared length of the vector. Lemma
Lemma (mathematics)

In mathematics, a lemma is a proven proposition which is used as a stepping stone to a larger result rather than as a statement in-and-of itself....
 1


Now consider two vectors a and b extending from the origin, separated by an angle ?. A third vector c may be defined as creating a triangle with sides a, b, and c. According to the law of cosines
Law of cosines

In trigonometry, the law of cosines is a statement about a general triangle which relates the lengths of its sides to the cosine of one of its angles....
, we have Substituting dot products for the squared lengths according to Lemma 1, we get                   (1) But as c = ab, we also have , which, according to the distributive law, expands to                     (2) Merging the two cc equations, (1) and (2), we obtain

Subtracting aa + bb from both sides and dividing by −2 leaves Q.E.D.
Q.E.D.

Q.E.D. is an abbreviation of the List of Latin phrases , which literally means "which was to be demonstrated". The phrase is written in its abbreviated form at the end of a mathematical proof or Philosophy Logical argument, to signify that the last statement deduced was the one to be demonstrated, so the proof is complete....


Generalization


The inner product
Inner product space

In mathematics, an inner product space is a vector space with the additional Mathematical structure of inner product. This additional structure associates each pair of vectors in the space with a Scalar quantity known as the inner product of the vectors....
 generalizes the dot product to abstract vector spaces
Vector space

File:Vector addition ans scaling.pngA vector space is a mathematical structure formed by a collection of vectors: objects that may be Vector addition together and Scalar multiplication by numbers, called scalar s in this context....
 and is normally denoted by <a , b>. Due to the geometric interpretation of the dot product the norm
Norm (mathematics)

In linear algebra, functional analysis and related areas of mathematics, a norm is a function that assigns a strictly positive length or size to all vectors in a vector space, other than the zero vector....
 ||a|| of a vector a in such an inner product space
Inner product space

In mathematics, an inner product space is a vector space with the additional Mathematical structure of inner product. This additional structure associates each pair of vectors in the space with a Scalar quantity known as the inner product of the vectors....
 is defined as

such that it generalizes length, and the angle ? between two vectors a and b by

In particular, two vectors are considered orthogonal if their inner product is zero

The Frobenius inner product generalizes the dot product to matrices. It is defined as the sum of the products of the corresponding components of two matrices having the same size.

Matrix representation


An inner product can be represented using a square matrix and matrix multiplication
Matrix multiplication

In mathematics, matrix multiplication is the operation of multiplying a matrix with either a scalar or another matrix. This article gives an overview of the various ways to perform matrix multiplication....
. For example, given two vectors

with respect to the basis set
Basis (linear algebra)

In linear algebra, a basis is a set of vectors that, in a linear combination, can represent every vector in a given vector space or free module, and such that no element of the set can be represented as a linear combination of the others....
 

any inner product can be represented as follows:

where M is a 3x3 matrix. Given the matrix of the inner products through S called CS, M can be calculated by solving the following system of equations.

If the basis set S is composed of orthogonal unit vectors (orthonormal basis
Orthonormal basis

In mathematics, an orthonormal basis of an inner product space V , is a set of mutually orthogonality vectors of magnitude 1 that span the space when infinite linear combinations are allowed....
), then both CS and M reduce to the identity matrix
Identity matrix

In linear algebra, the identity matrix or unit matrix of size n is the n-by-n square matrix with ones on the main diagonal and zeros elsewhere....
 1, and the inner product can be represented as a simple product between a row matrix and a column matrix:

Thus, if the basis is orthonormal, the square matrix M is not necessary and the inner product coincides with the dot product as defined above:

Example


Given a basis set

and a matrix of the inner product through

we can set each element of CS equal to the inner product of two of the basis vectors as follows


which gives nine equations and nine unknowns. Solving these equations yields

See also

  • Physics
    Physics

    Physics is the natural science which examines basic concepts such as energy, force, and spacetime and all that derives from these, such as mass, charge, matter and its Motion ....
  • Cross product
    Cross product

    In mathematics, the cross product is a binary operation on two vector s in a three-dimensional Euclidean space that results in another vector which is orthogonal to the plane containing the two input vectors....
  • Matrix multiplication
    Matrix multiplication

    In mathematics, matrix multiplication is the operation of multiplying a matrix with either a scalar or another matrix. This article gives an overview of the various ways to perform matrix multiplication....
  • Cauchy–Schwarz inequality
    Cauchy–Schwarz inequality

    In mathematics, the Cauchy?Schwarz inequality, also known as the Schwarz inequality, the Cauchy inequality, or the Cauchy?Schwarz?Bunyakovsky inequality, is a useful inequality encountered in many different settings, such as linear algebra applied to vector space, in mathematical analysis applied to infinite series and Integ...


External links


  • by Bruce Torrence, Wolfram Demonstrations Project
    Wolfram Demonstrations Project

    The Wolfram Demonstrations Project is a website developed by Wolfram Research, whose stated goal is to bring computational exploration to the widest possible audience....
    , 2007.