Cosine similarity
A fixed document vector and a query vector that can be rotated around the same origin. The cosine of the angle between them is 1 when they point the same way, 0 at a right angle, and negative 1 when they point in opposite directions.
cos 1
cos 0
cos −1
Document
θ
Query
θ =
45
°
cos θ =
0.707
Angle