CosineDistance
[u, v]The cosine distance is equivalent to $1 - (u.Conjugate[v]) / (Norm[u] Norm[v])$.
N[CosineDistance[{7, 9}, {71, 89}]]
When the length of either vector is 0, the result is 0:
CosineDistance[{0.0, 0.0}, {x, y}]
CosineDistance[{1, 0}, {x, y}]
The order of the vectors influences the result:
CosineDistance[{x, y}, {1, 0}]
Cosine distance includes a dot product scaled by norms:
CosineDistance[{a, b, c}, {x, y, z}]
A Cosine distance applied to complex numbers, uses Abs[]
for Norm[]
and complex multiplication for dot product,
1 - u * Conjugate[v] / (Abs[u] Abs[v]
):
CosineDistance[1+2I, 5]