Skip to content
Linear Algebra•beginner

Dot Product and Angle Between Vectors

Measuring similarity and projection through multiplication

Why This Matters for ML

Cosine similarity, attention mechanisms, and neuron activation all use dot products

Interactive Visualization

Interact with the visualization to explore

Dot Product

6.00

Angle

53.1°

The Key Intuition

The dot product measures how "aligned" two vectors are. When they point the same way, it's large and positive. When perpendicular, it's zero. When opposite, it's negative. This is why cosine similarity works — and why attention in transformers uses dot products!

Try It Yourself

Use the visualization controls to:

  • Drag vectors to see transformations in real-time
  • Adjust parameters with sliders
  • Observe how changes affect the output
  • Connect the visual behavior to the math