Orthogonal vectors
Two arrows are given by their components. Without drawing them or finding a single angle, how can you tell for certain that they meet at a right angle?
Where you are 3 in The dot product
Why this exists
Right angles are everywhere: the corner of a rectangle, a wall standing on a floor, the radius meeting a tangent line. Showing that two directions meet at exactly 90^\circ used to mean finding angles with inverse tangents, or comparing slopes and setting vertical lines aside as a special case. A picture is no proof: two arrows at 87^\circ look exactly like two at 90^\circ.
The dot product settles it with one line of arithmetic. Its sign table already had a row for zero: a right angle gives \mathbf{u} \cdot \mathbf{v} = 0. This lesson turns that row into a test that runs both ways and has no exceptions, then uses it to build perpendicular vectors, perpendicular lines and right triangles straight from coordinates.
Definition
Two vectors \mathbf{u} and \mathbf{v} are orthogonal, written \mathbf{u} \perp \mathbf{v}, when their dot product is zero:
For nonzero vectors this is exactly the same as being perpendicular: the angle between them is 90^\circ (proved below). The zero vector is the one exception to the picture. Since \mathbf{0} \cdot \mathbf{v} = 0 for every \mathbf{v}, the definition makes \mathbf{0} orthogonal to every vector, including itself. That is a convention adopted on purpose, so that statements like “every multiple of \langle -2, 3 \rangle is orthogonal to \langle 3, 2 \rangle” need no exception for the multiple 0. The zero vector has no direction, so it is never called perpendicular to anything.
Intuition
Take \mathbf{v} = \langle 3, 2 \rangle: three right, two up. Turn the arrow a quarter turn counterclockwise and the run of 3 becomes a rise of 3, while the rise of 2 becomes a run of 2 to the left. The turned arrow is \langle -2, 3 \rangle. The components swapped places and one changed sign, and the dot product sees it at once: (3)(-2) + (2)(3) = 0. The two products cancel because they are the same two numbers with opposite signs.
A quarter turn clockwise gives \langle 2, -3 \rangle, which points the opposite way along the same line. Stretching either one keeps it at right angles to \mathbf{v}, so the vectors orthogonal to \mathbf{v} fill the whole dashed line through the origin, and nothing off that line qualifies.
Results
The orthogonality test. Two nonzero vectors are perpendicular if and only if their dot product is zero:
Vectors orthogonal to a given one. For a nonzero vector \mathbf{v} = \langle a, b \rangle, the vectors \langle -b, a \rangle and \langle b, -a \rangle are orthogonal to \mathbf{v} and have the same length. Every vector orthogonal to \mathbf{v} is a scalar multiple k\langle -b, a \rangle for some real number k.
Perpendicular lines. Two lines with direction vectors \mathbf{d}_1 and \mathbf{d}_2 (any nonzero vectors along them) are perpendicular if and only if \mathbf{d}_1 \cdot \mathbf{d}_2 = 0. A line of slope m has direction vector \langle 1, m \rangle, so two lines with slopes m_1 and m_2 are perpendicular if and only if
The Pythagorean form. For any vectors \mathbf{u} and \mathbf{v},
and the same holds with \mathbf{u} - \mathbf{v} in place of \mathbf{u} + \mathbf{v}.
Why it is true
The test. Let \mathbf{u} and \mathbf{v} be nonzero with angle \theta between them, 0^\circ \le \theta \le 180^\circ. By the cosine formula,
Both lengths are positive, so the product is 0 exactly when \cos\theta = 0. On [0^\circ, 180^\circ] cosine is zero at one angle only, 90^\circ. So \mathbf{u} \cdot \mathbf{v} = 0 forces \theta = 90^\circ, and \theta = 90^\circ forces \mathbf{u} \cdot \mathbf{v} = 0. If either vector is \mathbf{0} there is no angle, and the dot product is 0 by the convention above.
Swap and negate. \langle a, b \rangle \cdot \langle -b, a \rangle = -ab + ba = 0 because multiplication is commutative, and \langle b, -a \rangle = -\langle -b, a \rangle. Both have length \displaystyle \sqrt{a^2 + b^2}, the length of \mathbf{v}.
Every orthogonal vector is a multiple. Suppose \langle x, y \rangle \cdot \langle a, b \rangle = 0, so ax + by = 0. If a \ne 0, then \displaystyle x = -\frac{b}{a}y and
If a = 0, then b \ne 0 (since \mathbf{v} is nonzero), so by = 0 gives y = 0, and \langle x, 0 \rangle = -\tfrac{x}{b}\langle -b, 0 \rangle, which is a multiple of \langle -b, a \rangle = \langle -b, 0 \rangle. Either way \langle x, y \rangle = k\langle -b, a \rangle.
Perpendicular lines. Two lines meet at a right angle exactly when their directions do, so the test applies to direction vectors. A line of slope m rises m for each 1 it runs, so \langle 1, m \rangle points along it. A vertical line has direction \langle 0, 1 \rangle and no slope, yet the vector test still works for it.
This agrees with what Sine and tangent of a sum or difference proved on its Day 2, that two lines with slopes are perpendicular exactly when m_1 m_2 = -1, and the two proofs are the same computation. If the lines make angles \theta_1 and \theta_2 with the positive x-axis, their unit direction vectors are \langle \cos\theta_i, \sin\theta_i \rangle = \cos\theta_i\,\langle 1, m_i \rangle, since m_i = \tan\theta_i. Their dot product is
where the middle step is the cosine difference formula. The left side is the dot product; the right side is the expression that lesson set to zero. The dot product reaches the slope rule (also met in Slopes of perpendicular lines) without any trigonometry.
The Pythagorean form. Expanding with the distributive and commutative properties,
which equals \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2 exactly when \mathbf{u} \cdot \mathbf{v} = 0. For nonzero vectors this is the The Pythagorean theorem and its converse at once.
Worked examples
Testing three pairs
Sakina has three pairs of vectors. Which pairs are orthogonal? (a) \langle 10, -4 \rangle and \langle 6, 15 \rangle; (b) \langle 7, 3 \rangle and \langle -3, 8 \rangle; (c) 4\mathbf{i} - 10\mathbf{j} and 5\mathbf{i} + 2\mathbf{j}.
SolutionCompute each dot product; the test needs nothing else.
(a) (10)(6) + (-4)(15) = 60 - 60 = 0. Orthogonal.
(b) (7)(-3) + (3)(8) = -21 + 24 = 3. Not orthogonal. The angle is
so a sketch would look like a right angle. The dot product is not fooled.
(c) In Unit vectors and i, j notation the components are \langle 4, -10 \rangle and \langle 5, 2 \rangle, so the dot product is 20 - 20 = 0. Orthogonal.
Every vector orthogonal to one vector
Find all vectors orthogonal to \mathbf{w} = \langle 20, 21 \rangle, and the unit vectors among them.
SolutionSwap the components and negate the new first one: \langle -21, 20 \rangle. Check: -420 + 420 = 0. By the result above, the vectors orthogonal to \mathbf{w} are exactly
A unit vector has length 1. Since \displaystyle \|\langle -21, 20 \rangle\| = \sqrt{441 + 400} = \sqrt{841} = 29, the multiples of length 1 are \displaystyle k = \pm\frac{1}{29}:
There are exactly two, one on each side of \mathbf{w}.
An unknown component
(a) Find k so that \langle k, 5 \rangle \perp \langle 9, -2 \rangle. (b) Find every c so that \langle c, 2 \rangle \perp \langle c, -8 \rangle.
SolutionOrthogonal means dot product zero, so each part becomes an equation.
(a) 9k - 10 = 0, so \displaystyle k = \frac{10}{9}. Check: \displaystyle 9 \cdot \frac{10}{9} - 10 = 0.
(b) c \cdot c + (2)(-8) = c^2 - 16 = 0, so c = 4 or c = -4. Both work: \langle 4, 2 \rangle \cdot \langle 4, -8 \rangle = 16 - 16 = 0 and \langle -4, 2 \rangle \cdot \langle -4, -8 \rangle = 16 - 16 = 0. The unknown appears in both vectors, so the equation is quadratic and can have two answers.
Perpendicular lines from direction vectors
(a) Line \ell_1 passes through (-1, -3) and (5, 1); line \ell_2 passes through (-2, 6) and (4, -3). Are they perpendicular? (b) Line \ell_3 passes through (2, 1) and (2, 7); line \ell_4 through (-3, 4) and (5, 4). Are they perpendicular?
SolutionThe vector from one point on a line to another is a direction vector for the line.
(a) \ell_1 has direction \langle 6, 4 \rangle and \ell_2 has direction \langle 6, -9 \rangle. Their dot product is 36 - 36 = 0, so the lines are perpendicular. The slopes agree: they are \displaystyle \frac{4}{6} = \frac{2}{3} and \displaystyle \frac{-9}{6} = -\frac{3}{2}, with product -1. Indeed \displaystyle \langle 6, 4 \rangle = 6\langle 1, \frac{2}{3} \rangle, so the dot product test on \langle 1, m \rangle is the slope test.
(b) The directions are \langle 0, 6 \rangle and \langle 8, 0 \rangle, with dot product 0 + 0 = 0: perpendicular. Here \ell_3 is vertical and has no slope, so the slope rule says nothing; the vector test covers it with no special case.
A line through a point, perpendicular to a direction
Find an equation of the line through (4, -1) perpendicular to a line with direction vector \langle 3, 7 \rangle.
SolutionA point (x, y) is on the new line exactly when the vector from (4, -1) to it, \langle x - 4, y + 1 \rangle, is orthogonal to \langle 3, 7 \rangle (or is zero, at (4, -1) itself, which the zero-vector convention covers). So
Check: 3(4) + 7(-1) = 12 - 7 = 5, so (4, -1) is on it. Its slope is \displaystyle -\frac{3}{7} and the given direction has slope \displaystyle \frac{7}{3}; the product is -1. Notice that the coefficients of 3x + 7y are the components of \langle 3, 7 \rangle: in a line ax + by = c, the vector \langle a, b \rangle is perpendicular to the line.
Finding the right angle of a triangle
Pavan plots J(-3, 2), K(1, 0) and L(4, 6). Does the triangle have a right angle, and where?
SolutionAt each corner, use the two vectors that leave that corner along the sides.
At J: \overrightarrow{JK} = \langle 4, -2 \rangle and \overrightarrow{JL} = \langle 7, 4 \rangle, with dot product 28 - 8 = 20. Not a right angle.
At K: \overrightarrow{KJ} = \langle -4, 2 \rangle and \overrightarrow{KL} = \langle 3, 6 \rangle, with dot product -12 + 12 = 0. A right angle.
At L: \overrightarrow{LJ} = \langle -7, -4 \rangle and \overrightarrow{LK} = \langle -3, -6 \rangle, with dot product 21 + 24 = 45. Not a right angle (and it could not be, since a triangle has at most one).
So \angle K = 90^\circ. Check with the Pythagorean form: \|\overrightarrow{KJ}\|^2 = 20, \|\overrightarrow{KL}\|^2 = 45 and \|\overrightarrow{JL}\|^2 = 65, and 20 + 45 = 65.
Where on the axis is the right angle?
Bushra has the points M(-1, 4) and N(5, 2). Find every point C on the x-axis for which \angle MCN is a right angle.
SolutionA point on the x-axis is C(x, 0). The angle at C is right exactly when \overrightarrow{CM} = \langle -1 - x, 4 \rangle and \overrightarrow{CN} = \langle 5 - x, 2 \rangle are orthogonal:
So C_1(1, 0) or C_2(3, 0). Check C_1: \langle -2, 4 \rangle \cdot \langle 4, 2 \rangle = -8 + 8 = 0. Check C_2: \langle -4, 4 \rangle \cdot \langle 2, 2 \rangle = -8 + 8 = 0.
The figure shows why there are two. Both points lie on the circle with diameter \overline{MN} (center (2, 3), radius \displaystyle \sqrt{10}), because an angle inscribed in a semicircle is a right angle (the angle in a semicircle). The x-axis crosses that circle twice.
Boundaries
- Perpendicular needs two nonzero vectors. The zero vector is orthogonal to everything by definition, but it has no direction, so “perpendicular” is reserved for nonzero vectors.
- The test needs exact components. A dot product of 0.001 from rounded data is not 0; it only says the angle is close to 90^\circ. Example 1(b) shows how close a non-right angle can look.
- The slope rule needs slopes. m_1 m_2 = -1 cannot describe a vertical line. The direction-vector test has no such gap.
- In the plane the orthogonal directions form one line. In three dimensions the vectors orthogonal to a nonzero vector fill a whole plane, so swapping two components and negating one finds some of them but not all.
Where this goes next
Every vector can be split into a piece along \mathbf{v} and a piece orthogonal to \mathbf{v}, and the length of the first piece is the Vector and scalar projection; orthogonality is what makes the split unique. The cross product produces a vector orthogonal to two given vectors in space, and Dot product, length and orthogonality in n dimensions carries the test \mathbf{u} \cdot \mathbf{v} = 0 into any number of dimensions, where there are no pictures to check against. The parent idea, The dot product, gathers these together.
Exercises
Testing orthogonality
- Are \langle 10, 15 \rangle and \langle -3, 2 \rangle orthogonal?
- Are \langle -5, 4 \rangle and \langle 4, 6 \rangle orthogonal? If not, is the angle between them acute or obtuse?
- Are 3\mathbf{i} + 7\mathbf{j} and 14\mathbf{i} - 6\mathbf{j} orthogonal?
- Are \displaystyle \langle \sqrt{2}, 3 \rangle and \displaystyle \langle 3\sqrt{2}, -2 \rangle orthogonal?
- Which of these are orthogonal to \langle -9, 4 \rangle: (a) \langle 8, 18 \rangle; (b) \langle -4, -9 \rangle; (c) \langle 4, -9 \rangle?
Finding orthogonal vectors
- Find two vectors orthogonal to \langle 11, -3 \rangle that point in opposite directions.
- Describe all vectors orthogonal to \langle -14, 10 \rangle, using a multiple of a vector with the smallest whole-number components.
- Find the unit vectors orthogonal to \langle 9, 40 \rangle.
- Find the vectors of length 34 orthogonal to \langle 15, 8 \rangle.
- Find the vector orthogonal to \langle 8, -3 \rangle whose first component is 6.
Unknown components
- Find k so that \langle k, -8 \rangle \perp \langle 6, 3 \rangle.
- Find k so that \langle 3, k \rangle \perp \langle k - 3, 5 \rangle.
- Find every c so that \langle c, 3 \rangle \perp \langle c, -12 \rangle.
- Show that no real c makes \langle c, 4 \rangle \perp \langle c, 9 \rangle.
- Find every k for which \langle k, 2 \rangle and \langle k - 1, -6 \rangle are orthogonal.
Lines and triangles
- Line \ell_1 passes through (-2, 5) and (4, 1), and \ell_2 through (1, 1) and (5, 7). Use direction vectors to decide whether they are perpendicular, then confirm with slopes.
- Find an equation of the line through (-1, 3) perpendicular to a line with direction vector \langle 2, 9 \rangle.
- Use direction vectors to decide whether y = 3x - 1 and x + 3y = 12 are perpendicular.
- Which angle of the triangle D(-1, 0), E(4, 1), F(3, 6) is a right angle?
- Sakina says the triangle P(1, 1), Q(7, 4), R(2, 7) has a right angle. Is she right? What kind of triangle is it?
- The triangle has vertices O(0, 0), U(4, 2) and W(-1, y). Find y so the right angle is at O, and find y so it is at U.
- Given \mathbf{u} \perp \mathbf{v}, \|\mathbf{u}\| = 5 and \|\mathbf{v}\| = 12, find \|\mathbf{u} - \mathbf{v}\|.
Reasoning
- Bushra says \langle 0, 0 \rangle is perpendicular to \langle 2, 1 \rangle because their dot product is 0. What is right and what is wrong in her statement?
- Prove that if \mathbf{u} \perp \mathbf{v} and \mathbf{u} \perp \mathbf{w}, then \mathbf{u} \perp (a\mathbf{v} + b\mathbf{w}) for all real numbers a and b.
- Prove that \|\mathbf{u} + \mathbf{v}\| = \|\mathbf{u} - \mathbf{v}\| exactly when \mathbf{u} \perp \mathbf{v}, and explain what it says about a parallelogram whose diagonals have equal length.
Answers
- Yes. (10)(-3) + (15)(2) = -30 + 30 = 0.
- No; acute. (-5)(4) + (4)(6) = -20 + 24 = 4 > 0.
- Yes. (3)(14) + (7)(-6) = 42 - 42 = 0.
- Yes. \displaystyle \sqrt{2} \cdot 3\sqrt{2} + 3(-2) = 6 - 6 = 0.
- (a) and (b). (a) -72 + 72 = 0; (b) 36 - 36 = 0; (c) -36 - 36 = -72 \ne 0.
- \langle 3, 11 \rangle and \langle -3, -11 \rangle. Swap and negate: (11)(3) + (-3)(11) = 0, and the second is -1 times the first.
- k\langle 5, 7 \rangle for any real k. Swapping and negating gives \langle -10, -14 \rangle = -2\langle 5, 7 \rangle, and \langle 5, 7 \rangle \cdot \langle -14, 10 \rangle = -70 + 70 = 0.
- \left\langle -\tfrac{40}{41}, \tfrac{9}{41} \right\rangle and \left\langle \tfrac{40}{41}, -\tfrac{9}{41} \right\rangle. \langle -40, 9 \rangle is orthogonal and has length \displaystyle \sqrt{1600 + 81} = 41.
- \langle -16, 30 \rangle and \langle 16, -30 \rangle. \langle -8, 15 \rangle is orthogonal with length 17, so double it: -240 + 240 = 0 and \displaystyle \sqrt{256 + 900} = 34.
- \langle 6, 16 \rangle. \langle 6, y \rangle \cdot \langle 8, -3 \rangle = 48 - 3y = 0 gives y = 16.
- k = 4. 6k - 24 = 0.
- k = \tfrac{9}{8}. 3(k - 3) + 5k = 8k - 9 = 0.
- c = 6 or c = -6. c^2 - 36 = 0.
- The dot product is c^2 + 36, and c^2 \ge 0 for every real c, so it is at least 36 and never 0.
- k = 4 or k = -3. k^2 - k - 12 = (k - 4)(k + 3).
- Perpendicular. Directions \langle 6, -4 \rangle and \langle 4, 6 \rangle give 24 - 24 = 0; slopes -\tfrac{2}{3} and \tfrac{3}{2} multiply to -1.
- 2x + 9y = 25. 2(x + 1) + 9(y - 3) = 0; check -2 + 27 = 25.
- Perpendicular. The first has direction \langle 1, 3 \rangle; the second is y = -\tfrac{1}{3}x + 4, with direction \langle 3, -1 \rangle; 3 - 3 = 0.
- \angle E. \overrightarrow{ED} = \langle -5, -1 \rangle and \overrightarrow{EF} = \langle -1, 5 \rangle give 5 - 5 = 0. At D the dot product is \langle 5, 1 \rangle \cdot \langle 4, 6 \rangle = 26 and at F it is \langle -4, -6 \rangle \cdot \langle 1, -5 \rangle = 26.
- No; it is acute. At P: \langle 6, 3 \rangle \cdot \langle 1, 6 \rangle = 24. At Q: \langle -6, -3 \rangle \cdot \langle -5, 3 \rangle = 21. At R: \langle -1, -6 \rangle \cdot \langle 5, -3 \rangle = 13. All three are positive, so every angle is acute.
- y = 2 at O; y = 12 at U. At O: \langle 4, 2 \rangle \cdot \langle -1, y \rangle = -4 + 2y = 0. At U: \langle -4, -2 \rangle \cdot \langle -5, y - 2 \rangle is 20 - 2(y - 2) = 24 - 2y = 0.
- 13. \|\mathbf{u} - \mathbf{v}\|^2 = 25 - 2(0) + 144 = 169.
- Right: \langle 0, 0 \rangle \cdot \langle 2, 1 \rangle = 0, so the two are orthogonal by definition. Wrong: the zero vector has no direction, so there is no angle between it and \langle 2, 1 \rangle and “perpendicular” does not apply.
- By the distributive property and scalars moving out, \mathbf{u} \cdot (a\mathbf{v} + b\mathbf{w}) equals a(\mathbf{u} \cdot \mathbf{v}) + b(\mathbf{u} \cdot \mathbf{w}), which is a(0) + b(0) = 0.
- By the expansion above, \|\mathbf{u} + \mathbf{v}\|^2 exceeds \|\mathbf{u} - \mathbf{v}\|^2 by 4\,\mathbf{u} \cdot \mathbf{v}, and lengths are never negative, so the lengths are equal exactly when \mathbf{u} \cdot \mathbf{v} = 0. The diagonals of the parallelogram on \mathbf{u} and \mathbf{v} are \mathbf{u} + \mathbf{v} and \mathbf{u} - \mathbf{v}, so equal diagonals force perpendicular sides: the parallelogram is a rectangle.