Cosine similarity
Also: cosine distance
The cosine of the angle between two vectors: their dot product divided by the product of their lengths. It is the standard similarity measure for embeddings; cosine distance is 1 minus it.
cos θ = (a · b) / (‖a‖ ‖b‖)
Example
a = (1, 1) and b = (1, 0) are 45° apart: cos θ = 1 / (√2 · 1) ≈ 0.707. (2, 2) and (1, 1) score exactly 1, because length does not matter.