Two vectors. One number.
The dot product takes two vectors and produces a number. For vectors in the plane, multiply matching components, then add the results.
Calculate one.
Let and . Multiply the horizontal components, multiply the vertical components, and add:
The result is 12, not another vector.
What does the number tell us?
The same dot product can be described using the lengths of the vectors and the angle between them:
Intuition
Adding and scaling say nothing about length or angle. One more operation, multiplying two vectors position by position and adding up, brings both back: it gives the length of a vector, the angle between two, and above all a test for being at right angles.
A shadow cast straight down onto the floor is longest when the stick lies flat and vanishes when it stands upright. The dot product measures how much of one vector lies along another in the same way.
and meet at a right angle: . Walked tip to tail they make a right triangle whose hypotenuse is , and .
Dot product, length and angle
The dot product of two vectors of multiplies them position by position and adds; written with matrices it is . The length of is and the distance between and is . The angle between non-zero vectors is defined by , a number between and by the theorem below. Vectors are orthogonal when .
The rules it obeys
- ; ; unless .
The Cauchy–Schwarz inequality
If both sides are . Otherwise is never negative, whatever is, and expanding it gives a quadratic in . At the where the quadratic is smallest, being non-negative says exactly . Only the three rules of the dot product were used.
Proof steps
If is , both sides are . From now on .
A squared length is never negative, for every real ; expand it with the rules.
Take the where the quadratic is smallest.
Substitute and simplify.
Multiply by and take square roots.
Applications
Practice
Multiply and Add
The dot product pairs the vectors position by position, multiplies each pair and adds. The result is a number, not a vector.
Try it
What is ?
Length
The length of a vector is the square root of its dot product with itself: Pythagoras in every dimension.
Try it
What is the length of ?
Try it
Which vector is orthogonal to ?
Angles
The cosine of the angle between two non-zero vectors is their dot product divided by both lengths.
Try it
What is the angle between and , in degrees?
Try it
What is the unit vector pointing the way does?
Try it
If , the angle between and is more than .
Try it
and are orthogonal, and . What is ?
Try it
A vector of length must be the zero vector.
Try it
What is the distance between and ?
What You Learned
- ; .
Final checkpoint
Try it
What is ?
Try it
Two unit vectors have dot product . What is the angle between them?
Try it
for every vector .
Completion
Lesson complete
Great work! You now know how to:
- compute dot products, lengths, distances and angles;
- test two vectors for being orthogonal;
- prove and use the Cauchy–Schwarz inequality;
- use Pythagoras for orthogonal vectors.