Skip to main content
Interactive 3D/Dot Products & Projections
u·v = 0.438 = |u||v|cos(θ)
θ = 80.0°
proj_u(v) = 0.243
|u| = 1.8|v| = 1.4
Vector u (indigo)
u angle (°)30°
|u| magnitude1.8
Vector v (orange)
v angle (°)110°
|v| magnitude1.4
Actions
About dot products
u·v = |u||v|cos(θ). Measures how much two vectors point in the same direction. Core operation in attention: Q·Kᵀ computes similarity between queries and keys.
Try: set u and v to 90° apart (θ=90°) - dot product = 0. They carry zero shared information.

Dot Products & Projections - Interactive Visualization

The dot product u·v = |u||v|cos(θ) is the single most-used operation in machine learning - it appears in attention (Q·Kᵀ), cosine similarity, projections, and neural network layers. This visualization shows two 2D vectors with adjustable angles and magnitudes. Click Project to animate the projection of v onto u - the geometric interpretation of the dot product.

  • Drag vector angles and lengths to see dot product change
  • Animate projection of v onto u with geometric interpretation
  • See when θ=90° makes vectors orthogonal (dot product = 0)
  • Understand cosine similarity: u·v / (|u||v|) = cos(θ)
  • Foundation for understanding transformers, attention, and retrieval

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.