← Simulators

šŸ“ Cosine vs Distance & 3D Embeddings

Compare similarity metrics and explore embedding space in 3D.

Cosine similarity vs Euclidean distance

AB

Cosine similarity (angle)

83.2%

Same direction → 1; orthogonal → 0

Euclidean distance

0.45

Length of line between A and B

Normalized vectors: cosine = dot product. DBs often use cosine for similarity.

3D embedding space (rotating)

Loading 3D…

Same words (cat, kitten, dog, pizza, …) as 3D points. Similar meaning = close in space.

Similarity search: metric, top-k, data type & weights

Metric

Top-k

5

Data type filter

Document labels & weights (top-5 results)

RankLabelTypeWeightSimilarity
1Doc Atext192%
2Doc Btext188%
3Doc Dtext182%
4Doc Emixed0.970%
5Doc Ccode0.868%

Weights can boost or downweight docs (e.g. by source or freshness). Data type helps filter before/after search.