[−][src]Function acap::cos::prenorm_cosine_similarity
pub fn prenorm_cosine_similarity<T, U>(x: T, y: U) -> T::Value where
T: Coordinates,
U: Coordinates<Value = T::Value>,
T::Value: Real,
Compute the cosine similarity between two pre-normalized (unit magnitude) points.
Use prenorm_cosine_distance()
instead if you are implementing Proximity::distance()
.
\begin{aligned}
\mathrm{prenorm\_cosine\_similarity}(x, y) &= x \cdot y \\
&= \sum_i x_i y_i \\
&= \cos \theta
\end{aligned}