Interactive guide
The dot product is a shadow's length, with a sign.
Drag either arrowhead. The shadow and angle follow.
A B shadow of A on B
A = ( 2.00, 1.00 ) B = ( 2.00, 0.00 )
—
- θ
- 0°
- A·B
- 0.00
- shadow length
- 0.00
—
—
Same number, two formulas. A·B = AxBx + AyBy is pure coordinate bookkeeping, no geometry required. A·B = |A||B|cosθ is pure geometry, no coordinates required. They always agree, drag either vector above and watch both live equations land on the exact same number, every time.
What the shadow actually is
Drop a perpendicular from the tip of A straight down onto the line B sits on. Where it lands is A's shadow on B, as if B's line were the ground and A were a stick with the sun directly overhead. The signed length of that shadow, from the origin, is called the scalar projection of A onto B.
The dot product is just that shadow length, scaled by how long B is: A·B = (shadow length) × |B|. Everything about the dot product's sign is really a statement about which side of the origin the shadow falls on.
Reading the sign
-
1
Acute angle (θ < 90°)
cosθ > 0, so A·B > 0. The shadow falls forward, on B's own side of the origin.
-
2
Right angle (θ = 90°)
cosθ = 0, so A·B = 0 exactly. The shadow shrinks to a single point: the origin itself.
-
3
Obtuse angle (θ > 90°)
cosθ < 0, so A·B < 0. The shadow falls behind the origin, on B's negative side.
-
4
The sign test needs no angle at all
Just compute AxBx + AyBy. Its sign alone tells you acute, right, or obtuse.
This is the same test hiding inside a huge amount of machine learning: cosine similarity is just A·B rescaled to sit between −1 and 1, and every neuron in a neural network runs a dot product between its input and its weights before anything else happens. Drag A past 90° from B here and you've just watched a neuron's pre-activation value cross zero.
The jargons
One number, computed two ways, with a picture underneath both.
A single number summarizing how much two vectors point the same way: Ax·Bx + Ay·By, equivalently |A||B|cosθ.
The signed length of A's shadow on B's line: A·B divided by |B|.
The scalar projection turned back into a vector, pointing along B: it's the actual point where the shadow lands.
Perpendicular. Two vectors are orthogonal exactly when their dot product is 0, no angle measurement required.
A vector's own length, √(Ax²+Ay²), independent of any other vector.
A·B divided by |A||B|: the dot product with the lengths divided back out, leaving just cosθ itself.