The dot product isn't just multiply and add. It measures how much two arrows point the same way.
Hook
Not Multiply and Add
The dot product is not multiply and add. It measures agreement.
- Dot product = agreement
Shadow
Projection Is a Shadow
Take two arrows. Drop a shadow of one onto the other.
- Project b onto a
- Shadow length matters
Shadow Times Length
The shadow's length, times the length of the first arrow, is the dot product.
- a dot b = |a| x shadow
Sign
Same Direction: Positive
Point the same way, and the result is positive.
- Aligned means positive
Right Angle: Zero
Stand at right angles, and the shadow vanishes. The result is zero.
- Perpendicular means zero
Opposite: Negative
Point opposite ways, and it turns negative.
- Opposed means negative
Cosine
Cosine Similarity
Ignore length, and you get cosine similarity. It is just the angle's cosine, from one to minus one.
- Length removed
- Range: -1 to 1
Payoff
How Search Finds Meaning
Search engines and embeddings use it to compare meaning. Close in direction means close in meaning. Follow for more visual math.
- Embeddings are arrows
- Similar direction, similar meaning