Vectors & Spaces · Lesson 2 of 3 · ~6 min

The dot product

Predict

The dot product $\mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2$ uses only components. Make $\mathbf{u}$ perpendicular to $\mathbf{v}$. What does it do?

Press set orthogonal and watch u · v as θ hits 90°.
Try
Try itDrag either tip and compare u · v with |u||v| cos θ. Then press set orthogonal and set opposed.
Notice

The two readouts always match. At the start both read $5.50 = 3(1) + 1(2.5)$. At $90°$ both read $0.00$ and the dotted proj shrinks to a point. Opposed, both go negative.

Explain

The dot product is one number with two formulas, one from components and one from lengths and angle:

$$\mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2 = \|\mathbf{u}\|\,\|\mathbf{v}\|\cos\theta$$

Why they agree: $\mathbf{v} \cdot \mathbf{v} = v_1^2 + v_2^2 = \|\mathbf{v}\|^2$ is Pythagoras. Expand $\|\mathbf{u} - \mathbf{v}\|^2$ with dot-product algebra, then with the law of cosines. Matching terms cancel, leaving the identity.

The sign comes from $\cos\theta$: positive when acute, negative when obtuse, zero at $90°$, where the vectors are orthogonal. The dotted projection is the shadow $\mathbf{u}$ casts on the line through $\mathbf{v}$.

Apply
Checkpoint — prove it to yourself

Two nonzero vectors satisfy $\mathbf{u} \cdot \mathbf{v} = 0$. What does that tell you?

At the start, $\mathbf{u} = (3, 1)$, $\mathbf{v} = (1, 2.5)$ and $\mathbf{u} \cdot \mathbf{v} = 5.50$. Double $\mathbf{v}$ to $(2, 5)$. What is $\mathbf{u} \cdot \mathbf{v}$ now?

Transfer: $\mathbf{w} = (2, -4)$ and $\mathbf{z} = (3, 1)$. Without drawing anything, is the angle between them acute, right, or obtuse?

Key idea

The dot product turns alignment into arithmetic. Positive means roughly the same way, zero means perpendicular, negative means roughly opposite.

APPLICATIONA neuron dots synaptic weights with inputs, then applies a threshold. Try it on a simulated cell.
← Lesson 1