A measure of the angular distance between two vectors. Usually defined as 1-(cosine similarity).

A distance measure of the angle between two vectors $\mathbf u$ and $\mathbf v$,

$$1 - \text{cos}(\mathbf u, \mathbf v)$$


$$\text{cos}(\mathbf u, \mathbf v) = \cfrac{\langle \mathbf u, \mathbf v \rangle}{\| \mathbf u \| \| \mathbf v \|} = \left\langle \cfrac{\mathbf u}{\| \mathbf u\|}, \cfrac{\mathbf v}{\| \mathbf v\|}\right\rangle,$$

or "cosine similarity," is the cosine of the angle between $\mathbf u$ and $\mathbf v$.

The cosine similarity and cosine distance functions are often used in Information Retrieval and Text Mining for document ranking and clustering.

See also