What is angular distance?

Angular distance is the actual angle between two vectors, derived from cosine similarity but reshaped into a proper mathematical distance that increases as vectors point in more different directions.
Created: Updated: 3 min read

Angular distance measures the actual angle between two vectors, expressed as a proper distance that increases as vectors point in more different directions, which makes it a close relative of cosine similarity but one that behaves as a true mathematical distance rather than a similarity score.

How is angular distance calculated from cosine similarity?

Cosine similarity, covered elsewhere in this glossary, produces a score describing how aligned two vectors’ directions are, but that score runs backwards compared to how a distance should behave: a cosine similarity of 1 means the vectors point in exactly the same direction, which should correspond to zero distance, not maximum distance. Angular distance fixes this by taking the angle itself — computed by applying the inverse cosine function to the cosine similarity score — and normalizing it into a proper distance where identical vectors sit at 0 and vectors pointing in completely opposite directions sit at the maximum possible value. This makes angular distance directly interpretable as an actual angle between two directions in space, rather than an abstract similarity number.

Why would a system use angular distance instead of simply negating cosine similarity?

The simplest way to turn a similarity score into something distance-like is just to flip its sign or subtract it from a constant, and for many practical purposes involving ranking, covered in this site’s page on choosing the right distance function, this simpler transformation of cosine similarity works perfectly well since it preserves the same ordering of results either way. Angular distance matters specifically in situations where the mathematical properties of a true distance function are required, not just a value that ranks results consistently — some algorithms and theoretical guarantees depend on the triangle inequality holding, covered elsewhere in this glossary, and a simple negation of cosine similarity does not satisfy that property the way angular distance does.

Does angular distance change which vectors end up ranked as most similar?

No — for the purpose of ranking a set of candidate vectors from most to least similar to a query, angular distance and cosine similarity always agree, since angular distance is built directly from the cosine similarity score through a transformation that preserves order rather than scrambling it. A vector with a higher cosine similarity to the query will always have a smaller angular distance, and the ranking that comes out the other end is identical either way. The distinction between the two matters for the mathematical guarantees a system needs, not for the practical outcome of which results get returned first.

Angular distance is best understood as cosine similarity reshaped into a form with proper distance properties, useful specifically when those properties matter mathematically rather than for changing search results. From here, the pages on cosine similarity and on the triangle inequality fill in the two ideas angular distance sits directly between.