Labs · Vectors

Dot product and cosine

Two vectors, one number: how much they point the same way, with and without their lengths.

Try this ▶ Drag vector b to match vector a exactly and watch the cosine similarity reach 1.0 — then point them in opposite directions to see it drop toward −1.0.

Computing…

Dot product and cosine — Labs — TransformerLab