Modern interactive lesson

Length, Distance, Dot Product, and Orthogonality

Measure vector geometry with the dot product. Visualize lengths, distances, angles, orthogonality, and orthogonal complements.

MathJax formulasLive calculatorsCanvas visualizationQuick checks

Big idea: dot product turns vectors into geometry

The dot product measures length, distance, angle, perpendicularity, and similarity.

$$u\cdot v=u^Tv=\sum_{i=1}^n u_iv_i.$$

Length

$\|u\|=\sqrt{u\cdot u}$

Distance

$\operatorname{dist}(u,v)=\|u-v\|$

Angle

$\cos\theta=\dfrac{u\cdot v}{\|u\|\|v\|}$

Dot product facts

Algebraic

The dot product is symmetric, distributive, and positive: $u\cdot u\ge0$.

Geometric

$u\cdot v=0$ means $u$ and $v$ are orthogonal, assuming both are nonzero.

Computational meaning: dot products are the basic operation behind projections, least squares, cosine similarity, and many data algorithms.

Geometry measurement lab

dot · norm · distance

Angle, similarity, and Cauchy--Schwarz

For nonzero vectors, the angle is determined by

$$\cos\theta=\frac{u\cdot v}{\|u\|\|v\|}.$$

Cosine similarity meter

$-1$ to $1$

Move the slider to rotate $v$ relative to $u=(1,0)$. The output is $\cos\theta$.

Orthogonal complements

The orthogonal complement of a subspace contains all vectors perpendicular to every vector in the subspace.

$$W^\perp=\{x:x\cdot w=0\text{ for all }w\in W\}.$$

Line and orthogonal complement in $\mathbb R^2$

perpendicular line

Chapter summary

Dot product

A number measuring alignment.

Orthogonal

Dot product zero.

Normalize

Divide by length to get a unit vector.

Quick check

If $u\cdot v=0$ and both vectors are nonzero, what does it mean?

Common mistake: the angle formula is not valid if either vector is zero.