Math and physics › Vectors
Dot product: how much two arrows point the same way
Know first: Vectors: arrows you can add
The dot product turns two arrows into one number: how far one runs along the other. Light on a surface, moss on top of rocks, a guard noticing a player, the bright rim around a silhouette and a character sliding along a wall all rest on it. This lesson shows what the number means in a picture, where the “multiply and add” formula comes from, and why it agrees with the formula that uses a cosine.
Why this matters
Plenty of people remember the formula a.x × b.x + a.y × b.y + a.z × b.z. Far fewer know why it works. Without that, you cannot tell why surface lighting is computed this way, why a moss mask multiplies the normal by “up,” or what to do when the result comes out negative.
The only prerequisite is the lesson on vectors: addition, length and normalizing. You do not even need trigonometry, because the cosine will show up here on its own.