Euler Hall — free maths guides

Test whether two vectors are orthogonal

Compute the dot product and conclude orthogonality only when it is exactly zero. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.

The whole skill in one line

> Two vectors are perpendicular (orthogonal) exactly when their dot product is > exactly zero.

u⊥w  ⟺  u⋅w=0.u\perp w \iff u\cdot w = 0.

Not "small". Not "close to zero". Zero.

The reason comes from the cosine formula:cos⁡θ=u⋅w∥u∥ ∥w∥\cos\theta=\dfrac{u\cdot w}{\|u\|\,\|w\|}. Both lengths are positive, so the cosine is zero exactly when the numerator is zero — andcos⁡θ=0\cos\theta=0 is preciselyθ=90∘\theta=90^\circ.

Why the test is an equality and what it costs to round

The test is an equality because that is what the cosine formula produces. Setu⋅w=0u\cdot w=0: the right-hand side is zero, andθ=arccos⁡(0)=90∘\theta=\arccos(0)=90^\circ, exactly. Every step is exact arithmetic — no approximation enters.

Now consider what happens if you treat a small product as zero. Sayu⋅w=1u\cdot w=1 and both lengths are100100. Thencos⁡θ=1/10000\cos\theta=1/10000, soθ\theta is about89.994∘89.994^\circ — visually indistinguishable from a right angle. But it is not one, and the consequences are not small:

- Pythagoras needs the cross term to vanish exactly; here it does not, and∥u+w∥2\|u+w\|^2 is off by22. - A projection formula assumes orthogonality; the error propagates. - In exact arithmetic, "nearly perpendicular" is simply a different case.

The lesson is not to distrust intuition — it is that the algebraic test is a single equality, and it is cheaper to check than any judgement of closeness.

Three worked examples, each making a different point

Perpendicular.u=(1,2,3)u=(1,2,3),w=(2,−1,0)w=(2,-1,0):u⋅w=2−2+0=0u\cdot w=2-2+0=0. Zero, so perpendicular.

Not perpendicular, and the reason is one term. The sameuu withw=(2,−1,1)w=(2,-1,1):u⋅w=2−2+3=3u\cdot w=2-2+3=3. One entry moved by one, and the verdict flipped. Orthogonality is fragile in exactly this way.

Several perpendicular partners. Foru=(1,2,0)u=(1,2,0), both(2,−1,0)(2,-1,0) and(0,0,5)(0,0,5) give product00. The second works becauseuu has no third component to pair with. There is no shortage of perpendicular vectors — a whole plane of them, in fact.

A pair that looks perpendicular but is not.u=(1,1)u=(1,1) andw=(1,−1)w=(1,-1) really are:1−1=01-1=0. Butu=(1,1)u=(1,1) andw=(2,−1)w=(2,-1) give2−1=12-1=1, so no. Pictures cannot tell these apart reliably.

By the end you can
  • Compute the dot product and conclude orthogonality only when it is exactly zero
  • Reject 'small', 'nearly zero' and 'the picture looks square' as evidence
  • Judge several candidates separately, since more than one can pass
  • Recognise that a zero dot product never implies a zero vector
Check yourself

(a)u=(3,−1,2)u=(3,-1,2),w=(1,2,0)w=(1,2,0). Perpendicular?

(b)u=(1,0,0)u=(1,0,0) andw=(0,7,0)w=(0,7,0). Perpendicular?

(c) Is the zero vector perpendicular to every vector?

Answers

(a)3−2+0=1≠03-2+0=1\neq0, so no.

(b)0+0+0=00+0+0=0, so yes — and note the lengths are11 and77. Different lengths, still a right angle.

(c) Yes:0⋅w=0\mathbf{0}\cdot w=0 for everyww. That is true but rarely what a question means — if you are testing orthogonality, check both vectors are nonzero first, or the answer carries no information.

Work out where to start — free, no accountAnswer six real questions — free, no account