Lab 10 Interactive: Angles and Similarity

Move vectors, compare distance with cosine similarity, discover orthogonality, see correlation as centered cosine similarity, and explore why high-dimensional random directions become nearly perpendicular.

1. Dot product, angle, and cosine similarity

The dot product measures alignment. Cosine similarity divides out length and keeps only direction.

2. Same pattern, different size

Scale Bob's ratings. Distance changes, but cosine similarity stays at 1 when Bob is a positive multiple of Alice.

3. Distance versus cosine

Move point B. Compare the question “How far?” with “How aligned?”

4. Correlation is centered cosine similarity

Change two three-entry score vectors. The app shows raw cosine similarity and centered cosine similarity.

5. Mini document search

A query is compared with five document vectors using cosine similarity.

6. High-dimensional angle simulator

Random vectors in high dimensions tend to be nearly orthogonal. Run the simulation and watch the cosine distribution concentrate near 0.