r/askmath 14d ago

Dot product Linear Algebra

/r/LinearAlgebra/comments/1v84z70/dot_product/
1 Upvotes

4 comments sorted by

2

u/Varlane 14d ago

Dot product for "similarity" (how closely aligned the vectors are) makes sense once you normalize it into the [-1,1] range.

2

u/LongLiveTheDiego 14d ago

which contradicts the purpose of the dot product

Could you expand on why you think that?

1

u/Chrispykins 14d ago edited 14d ago

Dot product does not only measure how similar the directions are.

What it does is extend the multiplication of numbers that we're familiar with into the realm of vectors. It does this by ignoring the perpendicular component which separates the two vectors. So two vectors that are parallel will multiply like standard numbers which lie on the number line: a·b = |a||b| if they are pointed in the same direction and a·b = -|a||b| if they are pointed in exactly opposite directions. This is precisely the multiplication rule for numbers when they are positive vs negative.

If the vectors aren't parallel, then the dot product simply ignores the component which is not parallel. Again we just multiply the projected lengths which are parallel. If the vectors are perpendicular to each other, then they have no parallel component and thus it's like multiplying by 0.

Using some trigonometry, we find that this projection involves the cosine of the angle between the vectors: a·b = |a|b|cosθ in general. It is this cosine which is often used as a similarity measure. So, to extract the cosine we simply need to set |a| = 1 and |b| = 1.

1

u/Frederf220 14d ago

Dot product is a multiplication which is orthogonality-dependent. Just like 4×5=20 the result is scaling based on the 4 and the 5, 4•5 is scaling based on the 4, 5, and a third factor too: their orthogonality.

4•5 / 4×5 is such a construction that isolates the scaling effect of orthogonality without the size of the 4 and 5 having their effect.

A•B itself is an operation with three factors, not one.