Why is simple matmul of embedding vectors describes theirs similarity?

I didn’t do the course yet, forgive me if I understand it wrong.

Basically, we are discussing how close the vectors are.
Cosine similarity is much simpler to understand when the vectors modules are equal to 1.
In this case, the cosine similarity
(a . b . cos (πœƒ))
will be reduced to cos(πœƒ) that is, magically, the product of the matrices.

Let’s get 2 vectors in x, y bidimensional space:

A = [x1, y1] at an horizontal angle of πœƒ1

B = [x2, y2] at an horizontal angle of πœƒ2

if they are normalized, the cosine similarity or dot product between them will be

∣A∣ * ∣B∣ * cos(πœƒ3)

where πœƒ3 = πœƒ2 - πœƒ1

and ∣A∣ = ∣B∣ = 1

but

cos( πœƒ2 - πœƒ1) = cos( πœƒ2)*cos( πœƒ1) + sen( πœƒ2)*sen( πœƒ1)

so, applying it to the definitions

cos(πœƒ_{1} ) = \frac {x_{1}}{A} = x_{1}
sen(πœƒ_{1} ) = \frac {y_{1}}{A} = y_{1}

we get that the cosine similarity will be:

x_{1} * x_{2} + y_{1} * y_{2}

As
A = [x1, y1]
and
B = [x2, y2]

Then the cosine similarity or dot product will be

A * B

We can see this also from the definition of cosine similarity:

cosine similarity=

CS=\frac {A * B}{|A|*|B|}

​

If the vectors are not normalized, the calculation gets much more complicated:

CS=\frac {x_{1}*x_{2}+y_{1}*y_{2}}{\sqrt{x_{1}^{2}+y_{1}^{2}}*\sqrt{x_{2}^{2}+y_{2}^{2}}}