sciandu
Mathematics

Mathematics

The dot product

Multiply two vectors and get a single number back. That number tells you the angle between them.

You can add , and that is easy to picture: hang two arrows one after the other. But how do you multiply two arrows? The answer is surprising: the result is not an arrow at all, but a single number. That is why the calculation is called the scalar product, because scalar is simply the word for an ordinary number without direction.

The calculation itself

The calculation is surprisingly simple: multiply the xx values, multiply the yy values and add the two. For a=(34)\vec{a} = (3|4) and b=(21)\vec{b} = (2|1) that gives 32+41=103 \cdot 2 + 4 \cdot 1 = 10. Done. No arrow, no magnitude, just the number 10. For vectors in space you simply add a third term.

ab=a1b1+a2b2\vec{a} \cdot \vec{b} = a_1 b_1 + a_2 b_2
Multiply matching coordinates, then add everything up.

Zero means perpendicular

Now comes the reason this calculation is so useful. Take a=(30)\vec{a} = (3|0), an arrow to the right, and b=(05)\vec{b} = (0|5), an arrow upwards. The dot product is 30+05=03 \cdot 0 + 0 \cdot 5 = 0. That is no accident: the dot product is zero exactly when the two vectors are perpendicular to each other. So you have a right-angle test that needs no drawing and no protractor.

Coordinate grid
x3
y2
-6-6-4-4-2-2224466
P (3 | 2)
Read the point as the tip of a vector starting at the origin. Set it to (4|2), that is a\vec{a}. The vector (24)(-2|4) is perpendicular to it, because 4(2)+24=04 \cdot (-2) + 2 \cdot 4 = 0. Set the point to (−2|4) and look at the right angle between the two imagined arrows. The rule behind it: swapping the coordinates and flipping one sign always gives a perpendicular vector.

The angle in between

Perpendicular is only the special case. In general the dot product is linked to the angle: ab=abcosα\vec{a} \cdot \vec{b} = |\vec{a}| \cdot |\vec{b}| \cdot \cos \alpha. Rearranged for cosα\cos \alpha this gives you the angle between any two vectors without drawing anything. And because cos90°=0\cos 90° = 0, the rule from before drops out automatically.

cosα=abab\cos \alpha = \frac{\vec{a} \cdot \vec{b}}{\left| \vec{a} \right| \cdot \left| \vec{b} \right|}
The single number from the dot product on top, the two lengths below.

The sign alone already tells you something, before you calculate anything. If the dot product is positive, the two vectors roughly point the same way and the angle is less than 90°. If it is negative, they point away from each other and the angle is more than 90°. If it is 0, they are exactly perpendicular.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

What is the result of a dot product?

Work out the dot product of a=(25)\vec{a} = (2|5) and b=(41)\vec{b} = (4|1).

Which vector is perpendicular to a=(32)\vec{a} = (3|2)?

If the dot product of two vectors is 0, then they are to each other.

How long is the vector a=(68)\vec{a} = (6|8)?

Match each dot product to what it says about the angle.

Positive
Zero
Negative