# cosine similarity

Full Screen

### Click on the various examples

Each example is a random vector in the same “space” as the sample in the top left.

### Drag on individual rows

Each row represents one dimension of our vectors. You can drag them back and forth to change the value of our vector for that dimension.

### Watch how the similarity bar changes

The bar below each vector is a measure of how similar it is to the sample in the top left.

### Whats going on?

Cosine similarity is a technique for getting the “distance” between two vectors in high-dimensional spaces. We intuitively understand distance in 2 and 3 dimensions, but what happens if we have more than that? It can be convenient to calculate a single number that tells us how similar or different two high-dimensional vectors are.

I made this explanation because I’m trying to use find similar blocks and in order to do that I need to understand cosine similarity. They say nothing helps you understand better than trying to explain it!