The Dot Product
The dot product converts two vectors into a scalar measuring directional alignment. Zero indicates perpendicular directions when neither vector is zero.
Start with a case you can inspect
$(2,1)\cdot(3,-6)=2(3)+1(-6)=0$, so the nonzero vectors meet at a right angle.
- Step 1 - Check both vectors have the same number of components: u = (3, 4) and v = (4, 3) are both 2-dimensional, so the dot product is defined
- Step 2 - Multiply the matching components: first components: 3 x 4 = 12, and second components: 4 x 3 = 12
- Step 3 - Add those products: u dot v = 12 + 12 = 24, a single number and not a vector
- Step 4 - Find each length with the Pythagorean theorem: length of u = square root of (3^2 + 4^2) = square root of 25 = 5, and the length of v is also 5
- Step 5 - Divide to get the cosine of the angle: cos(theta) = 24 / (5 x 5) = 24 / 25 = 0.96
- Step 6 - Take the inverse cosine: theta = arccos(0.96) is about 16.3 degrees, a small angle, so the vectors nearly point the same way
- Step 7 - Test a perpendicular pair: (3, 4) dot (-4, 3) = -12 + 12 = 0, so those two meet at exactly 90 degrees
- Step 8 - Test an opposite pair: (3, 4) dot (-3, -4) = -9 - 16 = -25, which is minus the length of u times the length of v, so the angle is 180 degrees
Change one feature and predict what follows
Find the projection of $(4,2)$ onto $(1,1)$ and explain how the dot product determines its signed length.
Show the worked answer after attempting it
Let u = (4, 2) and v = (1, 1). First compute u dot v = (4)(1) + (2)(1) = 4 + 2 = 6, and v dot v = (1)(1) + (1)(1) = 2. The projection is (u dot v divided by v dot v) times v = (6 / 2)(1, 1) = 3(1, 1) = (3, 3). The dot product supplies the signed length.
The length of v is the square root of 2, so the scalar projection, the signed distance along v, is 6 divided by the square root of 2, which is about 4.24, and the vector (3, 3) does have length 3 times the square root of 2, about 4.24. Because the dot product came out positive, that signed length is positive and the shadow falls on the same side as v.
If u had been (-4, -2), the dot product would be -6, the projection would be (-3, -3), and the negative sign would tell you the shadow lands behind the starting point. A dot product of 0 would mean u casts no shadow along v at all, since the two would be perpendicular.
Reference and notation for the dot product
What the sign of the dot product says about the angle between two nonzero vectors
| Dot product | Angle between them | What the vectors are doing | Example |
|---|---|---|---|
| Equal to length times length (largest possible) | 0 degrees | Pointing in exactly the same direction | (3, 4) dot (6, 8) = 18 + 32 = 50 = 5 x 10 |
| Positive but smaller than that | Between 0 and 90 degrees | Leaning the same general way | (3, 4) dot (4, 3) = 12 + 12 = 24 |
| Exactly zero | Exactly 90 degrees | Perpendicular, also called orthogonal | (3, 4) dot (-4, 3) = -12 + 12 = 0 |
| Negative | Between 90 and 180 degrees | Leaning the opposite general way | (3, 4) dot (-1, 0) = -3 + 0 = -3 |
| Equal to minus length times length (most negative) | 180 degrees | Pointing in exactly opposite directions | (3, 4) dot (-3, -4) = -9 - 16 = -25 |
| A vector dotted with itself | 0 degrees with itself | Gives the length squared | (3, 4) dot (3, 4) = 9 + 16 = 25 = 5^2 |
Language you need to use precisely
- Dot product
- The dot product of two vectors is the number you get by multiplying their matching components and adding the results, and it is also equal to the two lengths multiplied by the cosine of the angle between them.
- Orthogonal vectors
- Two nonzero vectors are orthogonal when their dot product is zero, which is another way of saying they meet at a right angle.
- Magnitude
- The magnitude of a vector is its length, found by taking the square root of the dot product of the vector with itself.
- Unit vector
- A unit vector is a vector whose magnitude is exactly 1, and you build one by dividing a vector by its own length so only its direction survives.
- Projection
- The projection of u onto v is the shadow u casts along the direction of v, and its formula is the dot product of u and v divided by the dot product of v with itself, times v.
- Scalar
- A scalar is an ordinary single number with no direction attached, which is exactly what a dot product returns, unlike a cross product.
What the model assumes
Know vector components, multiplication and addition, vector magnitude, and the cosine of an angle. Continue through Multivariable Calculus when you need the complete sequence.
Move from the model to the symbols
- Confirm both vectors have the same dimension and multiply corresponding components.
- Add the component products to obtain the scalar dot product.
- Use the sign, zero value, or formula $u\cdot v=\|u\|\|v\|\cos\theta$ to interpret alignment.
Test the interpretation and its limits
A result is useful only when it survives the original conditions and a second line of reasoning. Check the completed work before studying the error pattern below.
Check the dot product by a second route
Compute their slopes or use the cosine formula; a zero cosine confirms an angle of $90^\circ$.
Use the dot product beyond one example
Game lighting
A renderer dots the surface normal of a wall with the direction to the lamp; a large positive value means the surface faces the light and is drawn bright, while a value at or below zero means it faces away and stays dark.
Physics work
The work done by a force is the dot product of the force vector and the displacement vector, which is why pushing sideways on a moving cart does no work at all: the dot product is zero.
Recommendation engines
Documents and user tastes are stored as long lists of numbers, and the cosine of the angle between two of those vectors, computed from a dot product, is what ranks how similar they are.
Connected ideas worth studying next
- Matrix operations: Each entry of a matrix product is one row dotted with one column, so a dot product is a single-entry matrix multiplication.
- Pythagorean theorem: Taking the square root of a vector dotted with itself is literally the Pythagorean theorem applied to the vector's components.
- The unit circle: The formula u dot v equals length times length times cosine is what links this algebra to the cosine values you read off the unit circle.
Ask for help with the decision, not only the answer
Bring your complete the dot product problem and the first step you cannot justify to the AI math solver. Ask it to explain that decision, then reproduce the method and check it against the original conditions.
Questions students ask about the dot product
What does it mean when the dot product is zero?
If neither vector is the zero vector, it means they are perpendicular, since cosine of 90 degrees is 0. That is the fastest orthogonality test there is: (3, 4) dot (-4, 3) = -12 + 12 = 0, so those directions meet at a right angle without you ever computing an angle. The zero vector dots to 0 with everything, which is why it is excluded.
What is the difference between the dot product and the cross product?
The dot product takes two vectors and returns a single number that measures alignment, and it works in any number of dimensions. The cross product takes two 3-dimensional vectors and returns a new vector perpendicular to both, measuring how much they spread apart. Alignment versus perpendicularity, number versus vector.
Can a dot product be negative, and what does that mean?
Yes. A negative dot product means the angle between the vectors is more than 90 degrees, so they lean in generally opposite directions. (3, 4) dot (-1, 0) = -3 says the second vector points somewhat against the first. The most negative value possible is minus the product of the two lengths, which happens at exactly 180 degrees.
Why does a vector dotted with itself give its length squared?
Because the components multiply against themselves: (3, 4) dot (3, 4) = 3 squared plus 4 squared = 25, which is exactly the Pythagorean sum under the square root in the length formula. It also matches the angle formula, since the angle between a vector and itself is 0 degrees and cosine of 0 is 1, leaving length times length.