Slopes of perpendicular lines
Two lines on a grid cross. How can their equations alone tell you whether they cross at a right angle?
Where you are 11 in Linear relationships
Why this exists
Parallel lines are easy to spot from their equations: they have the same Slope. The other special way for two lines to sit is at a right angle, and that one is harder to see. A sketch of two lines crossing at 89^\circ looks exactly like a sketch of two lines crossing at 90^\circ, and a protractor laid on a drawing measures the drawing, not the lines.
Coordinates settle it exactly. Once each line has a slope, one multiplication decides whether the lines are perpendicular, with no measuring at all. That turns questions about square corners into arithmetic: whether a triangle given by its corners has a right angle, whether four points make a rectangle, which way the tangent to a circle runs. It is the test that lets algebra prove things about right angles.
Definition
Two lines are perpendicular when they cross at a right angle. With a symbol this is written \ell_1 \perp \ell_2.
On the coordinate plane there is a test for this in terms of slope. Two lines that are not vertical, with slopes m_1 and m_2, are perpendicular exactly when their slopes multiply to -1:
Dividing both sides by m_1 (which is not zero, since the product is not zero) gives the same fact the other way round. Each slope is the negative reciprocal of the other:
To get the negative reciprocal of a number, take its reciprocal (flip the fraction) and change its sign. The negative reciprocal of \displaystyle \frac{2}{3} is \displaystyle -\frac{3}{2}, the negative reciprocal of -4 is \displaystyle \frac{1}{4}, and the negative reciprocal of 1 is -1. Both parts are needed: \displaystyle \frac{2}{3} and \displaystyle -\frac{2}{3} have opposite signs but multiply to \displaystyle -\frac{4}{9}, and \displaystyle \frac{2}{3} and \displaystyle \frac{3}{2} are reciprocals but multiply to 1.
Two kinds of line need separate treatment. A horizontal line has slope 0, and 0 has no reciprocal; a vertical line has no slope at all. A horizontal line and a vertical line are perpendicular, since the grid lines themselves meet square, but the product test says nothing about them.
Intuition
Figure 1 draws the line through V with slope \displaystyle \frac{2}{3}, together with one of its slope triangles: run 3, rise 2, ending at P(3, 2), counting from V.
Now give the whole picture a quarter turn counterclockwise about V. Every line through V turns by 90^\circ, so the turned line is perpendicular to the first one. The slope triangle turns with it and keeps its shape, but its legs change jobs. The run of 3, which went right, now goes up: it has become a rise of 3. The rise of 2, which went up, now goes left: it has become a run of -2. The point P(3, 2) lands on P'(-2, 3), and the turned line has slope
Nothing about the numbers 2 and 3 mattered. A slope triangle with rise a and run b turns into one with rise b and run -a, so a slope of \displaystyle \frac{a}{b} turns into \displaystyle \frac{b}{-a} = -\frac{b}{a}. Rise and run trading places is the reciprocal; the run that now points left is the minus sign.
This also explains how a perpendicular pair looks. A steep line has a shallow perpendicular, and the other way round, because a large number has a small reciprocal. And one line of the pair rises while the other falls, because their slopes have opposite signs.
Results
Perpendicular slopes. Two lines, neither of them vertical, with slopes m_1 and m_2, are perpendicular if and only if
Horizontal and vertical lines. Every horizontal line y = b is perpendicular to every vertical line x = a. A horizontal line is perpendicular to no line that has a slope.
Two perpendiculars to one line. If two lines are both perpendicular to a line of slope m \ne 0, each of them has slope \displaystyle -\frac{1}{m}, so they are parallel or they are the same line. If the given line is horizontal, both perpendiculars are vertical, and if it is vertical, both are horizontal; either way they are again parallel or the same.
Standard form. When A and B are both nonzero, the line Ax + By = C has slope \displaystyle -\frac{A}{B} and the line Bx - Ay = D has slope \displaystyle \frac{B}{A}. These multiply to -1, so the two lines are perpendicular whatever C and D are. In standard form, swapping the two coefficients and changing the sign of one of them gives a perpendicular line. Exercise 24 asks why this still holds when A or B is zero.
Why it is true
Sliding a line without turning it changes neither its slope nor any angle it makes with another line. So slide both lines until they pass through the origin O: their equations become y = m_1 x and y = m_2 x, with the same slopes as before. If m_1 = m_2 the slid lines are one and the same line, so they make no right angle, and m_1 m_2 = m_1^2 is not -1 either; the statement holds in that case. From here on, m_1 \ne m_2.
The vertical line x = 1 crosses the first line at A(1, m_1) and the second at B(1, m_2), as in Figure 2. These are different points, so O, A and B form a triangle, and its angle at O is the angle between the two lines.
The distance formula gives the squares of the three sides:
By the Pythagorean theorem, if the angle at O is a right angle then OA^2 + OB^2 = AB^2. By its converse, if OA^2 + OB^2 = AB^2 then the angle at O is a right angle. So the lines are perpendicular exactly when
Each line follows from the one before and leads back to it: the second expands a square, the third subtracts m_1^2 + m_2^2 from both sides, the fourth divides both sides by -2. So the first line holds exactly when the last one does, and that is the “if and only if”.
The quarter turn in the Intuition section reaches the same result by a different road, through a slope triangle and its turned copy rather than through squared lengths.
Worked examples
Negative reciprocals
Find the slope of a line perpendicular to a line with slope (a) 4, (b) \displaystyle -\frac{2}{5}, (c) 1, (d) 0.
Solution(a) The reciprocal of 4 is \displaystyle \frac{1}{4}, and changing the sign gives \displaystyle -\frac{1}{4}. Check: \displaystyle 4 \cdot \left(-\frac{1}{4}\right) = -1.
(b) The reciprocal of \displaystyle -\frac{2}{5} is \displaystyle -\frac{5}{2}, and changing the sign gives \displaystyle \frac{5}{2}. Check: \displaystyle -\frac{2}{5} \cdot \frac{5}{2} = -1. A falling line has a rising perpendicular.
(c) The reciprocal of 1 is 1, and changing the sign gives -1. The lines y = x and y = -x are the two diagonals of the grid squares, and they cross square.
(d) There is no number to give. A line of slope 0 is horizontal, so the lines perpendicular to it are vertical, and a vertical line has no slope. The answer is “vertical”, not a number.
Testing pairs of lines
Decide whether the lines in each pair are perpendicular.
(a) y = 3x - 1 and x + 3y = 6
(b) 2x - 5y = 10 and 5x + 2y = 4
(c) \displaystyle y = \frac{2}{3}x + 1 and \displaystyle y = -\frac{2}{3}x + 4
SolutionThe test needs both slopes, so first put any equation that is not already in slope-intercept form into it.
(a) The first slope is 3. For the second, subtract x from both sides and divide by 3:
The slopes are 3 and \displaystyle -\frac{1}{3}, and \displaystyle 3 \cdot \left(-\frac{1}{3}\right) = -1. The lines are perpendicular.
(b) Solve each equation for y. From 2x - 5y = 10, subtracting 2x gives -5y = -2x + 10, and dividing by -5:
From 5x + 2y = 4, subtracting 5x gives 2y = -5x + 4, and dividing by 2:
Then \displaystyle \frac{2}{5} \cdot \left(-\frac{5}{2}\right) = -1, so the lines are perpendicular. This pair is the standard-form pattern from the Results: the coefficients 2 and -5 have swapped places and one sign has changed.
(c) The product is \displaystyle \frac{2}{3} \cdot \left(-\frac{2}{3}\right) = -\frac{4}{9}, which is not -1, so the lines are not perpendicular. One rises and the other falls, but for a right angle the second slope would have to be \displaystyle -\frac{3}{2}. The slopes differ, so the lines do cross; they just do not cross square.
Is the triangle right-angled?
Triangle ABC has corners A(-3, 0), B(1, 2) and C(2, 0), as in Figure 3. Does it have a right angle, and if so, where?
A right angle at a corner means the two sides meeting there are perpendicular, so find the slope of each side from its endpoints:
AB and BC meet at B, and \displaystyle \frac{1}{2} \cdot (-2) = -1, so they are perpendicular: the triangle has a right angle at B. The other corners are not right angles. At A and at C one side is the horizontal AC, and the other side is not vertical.
Check. The side lengths should satisfy the Pythagorean theorem with AC as the hypotenuse: AB^2 = 4^2 + 2^2 = 20, BC^2 = 1^2 + 2^2 = 5 and AC^2 = 5^2 = 25, and 20 + 5 = 25.
Finding a coefficient
For what value of k is the line 2x + ky = 7 perpendicular to the line y = -3x + 1?
SolutionIf k = 0, the first line is 2x = 7, which is vertical, and a vertical line is not perpendicular to a line of slope -3. So k \ne 0, and dividing by k is allowed:
The slope is \displaystyle -\frac{2}{k}. For a right angle with the slope -3, the product must be -1:
The second line multiplies both sides by k, which is allowed since k \ne 0.
Check. 2x - 6y = 7 has slope \displaystyle -\frac{2}{-6} = \frac{1}{3}, and \displaystyle -3 \cdot \frac{1}{3} = -1.
Two values that work
For which values of k are the lines y = kx + 1 and 2y = (2k - 5)x + 3 perpendicular?
SolutionThe first slope is k. Dividing the second equation by 2 shows that its slope is \displaystyle \frac{2k - 5}{2}. Set the product equal to -1, multiply both sides by 2 to clear the fraction, and solve the quadratic by factoring:
So \displaystyle k = \frac{1}{2} or k = 2.
Check both. With k = 2 the slopes are 2 and \displaystyle \frac{4 - 5}{2} = -\frac{1}{2}. With \displaystyle k = \frac{1}{2} they are \displaystyle \frac{1}{2} and \displaystyle \frac{1 - 5}{2} = -2. Each pair multiplies to -1. The two answers give the same two slopes, 2 and \displaystyle -\frac{1}{2}, with the roles of the lines swapped.
A rectangle from its corners
Show that P(0, 0), Q(4, 2), R(3, 4) and S(-1, 2), taken in order, are the corners of a rectangle (Figure 4). Is it a square?
Find the slope of each side from its endpoints:
Opposite sides have equal slopes, so PQ \parallel RS and QR \parallel SP, and the shape is a parallelogram. At each corner a side of slope \displaystyle \frac{1}{2} meets a side of slope -2, and \displaystyle \frac{1}{2} \cdot (-2) = -1, so every corner is a right angle. A parallelogram with right angles is a rectangle.
For a square, neighboring sides would also have to be equal. But PQ^2 = 4^2 + 2^2 = 20 while QR^2 = (-1)^2 + 2^2 = 5, so \displaystyle PQ = 2\sqrt{5} and \displaystyle QR = \sqrt{5}. The rectangle is not a square.
The direction of a tangent
The circle with center O(0, 0) and radius 13 passes through T(-5, 12). Find the slope of the tangent line to the circle at T, and decide whether the tangent passes through (7, 17).
SolutionT is on the circle because its distance from O is \displaystyle \sqrt{(-5)^2 + 12^2} = \sqrt{169} = 13. A tangent to a circle is perpendicular to the radius at the point where it touches. The radius OT has slope \displaystyle \frac{12 - 0}{-5 - 0} = -\frac{12}{5}, so the tangent has the negative reciprocal as its slope:
The line from T to (7, 17) has slope \displaystyle \frac{17 - 12}{7 - (-5)} = \frac{5}{12}. That is the tangent’s slope, and both lines pass through T, so they are the same line: (7, 17) is on the tangent. Writing out the tangent’s full equation from here is the next skill, writing a perpendicular line through a point.
Boundaries
Vertical lines have no slope. The test m_1 m_2 = -1 needs two numbers, so it cannot be used when either line is vertical. A vertical line is perpendicular to exactly the horizontal lines, and that is read straight off the equations x = a and y = b.
Slope 0 has no negative reciprocal. The expression \displaystyle -\frac{1}{0} is not a number. The perpendicular to a horizontal line is vertical, which is a direction with no slope, not a line with a very large slope.
The product must be exactly -1. Slopes of 0.33 and -3 multiply to -0.99, and lines with those slopes miss a right angle by a little. Rounding a slope can turn a perpendicular pair into one that is not, so the slopes are kept as exact fractions.
Both axes must use the same unit. Slope compares a distance up with a distance across, and a right angle is a fact about true distances. If a graph stretches one axis, perpendicular lines are drawn at some other angle, though the algebra is unchanged. When the two axes measure different things, such as hours across and kilometers up, a right angle on the graph has no meaning, and the product of the slopes has nothing to report.
The lines lie in one plane. The test is about lines in the coordinate plane. In space a line has no single slope, and two lines can miss each other without being parallel; right angles there are tested with the dot product instead.
Segments are tested through their lines. Two segments are called perpendicular when the lines containing them are, even if the segments themselves do not touch.
Where this goes next
The most direct use is writing the line through a given point perpendicular to a given line: the negative reciprocal supplies the slope, and point-slope form does the rest. That in turn gives the perpendicular bisector of a segment from its endpoints, the altitudes of a triangle and the point where they meet, its orthocenter, and the distance from a point to a line, which is measured along the perpendicular.
In coordinate proofs the slope test is how a right angle gets proved. A rectangle, a right triangle, a rhombus with perpendicular diagonals: each comes down to multiplying two slopes.
Later the same condition returns in another form. A line of slope m runs in the direction of the arrow (1, m), one step across and m up. For two such arrows,
and this is zero exactly when m_1 m_2 = -1. That sum is the dot product of the two arrows, and vectors at right angles are exactly the ones whose dot product is zero. That version needs no slopes, so it works for vertical lines too, and in space.
Exercises
Negative reciprocals
Find the slope of a line perpendicular to a line with the given slope.
- 5
- \displaystyle -\frac{3}{4}
- \displaystyle \frac{1}{6}
- -1
- 0.4
- 0
Perpendicular or not
Decide whether the two lines are perpendicular.
- y = 4x + 1 and \displaystyle y = -\frac{1}{4}x - 3
- \displaystyle y = \frac{3}{2}x and \displaystyle y = \frac{2}{3}x + 5
- x - 2y = 6 and 2x + y = 1
- 3x + 4y = 12 and 4x + 3y = 12
- y = 5 and x = -2
- The line through (-1, 1) and (2, 7), and the line through (0, 3) and (6, 0)
Right angles from coordinates
- Triangle ABC has corners A(0, 0), B(4, 2) and C(1, 8). Find the slope of each side, and decide where, if anywhere, the triangle has a right angle.
- Triangle PQR has corners P(-1, 3), Q(2, 1) and R(5, 4). Is it a right triangle?
- Show that A(1, 1), B(5, 3), C(3, 7) and D(-1, 5), taken in order, are the corners of a rectangle. Is it a square?
- Quadrilateral EFGH has corners E(0, 0), F(3, 1), G(4, 4) and H(1, 3). Find the slopes of its diagonals EG and FH. Are the diagonals perpendicular?
Unknown coefficients
- For what value of k is y = kx + 9 perpendicular to y = 6x - 2?
- For what value of a is ax + 5y = 2 perpendicular to y = 4x - 3?
- The line through (2, t) and (6, 5) is perpendicular to y = -2x + 7. Find t.
- For which values of k are y = kx + 2 and 3y = (3k - 10)x + 1 perpendicular?
- The points O(0, 0), A(4, 2) and P(a, 6) form a triangle. For what value of a does the triangle have a right angle at A?
Reasoning
- Explain why two lines that both have positive slopes can never be perpendicular.
- Lines p and q are both perpendicular to a line \ell of slope m \ne 0. Show that p and q are parallel or are the same line.
- Show that Ax + By = C and Bx - Ay = D are perpendicular for any numbers A and B that are not both zero, including when one of them is zero.
- Slopes of 0.33 and -3 look like a perpendicular pair, since 0.33 is close to \displaystyle \frac{1}{3}. Are lines with these slopes perpendicular? Explain.
Answers
- \displaystyle -\frac{1}{5}. The reciprocal of 5 is \displaystyle \frac{1}{5}; change the sign. Check: \displaystyle 5 \cdot \left(-\frac{1}{5}\right) = -1.
- \displaystyle \frac{4}{3}. The reciprocal of \displaystyle -\frac{3}{4} is \displaystyle -\frac{4}{3}; change the sign.
- -6. The reciprocal of \displaystyle \frac{1}{6} is 6; change the sign.
- 1. The reciprocal of -1 is -1; change the sign. The lines y = -x and y = x cross square.
- \displaystyle -\frac{5}{2}. Write \displaystyle 0.4 = \frac{2}{5}; its reciprocal is \displaystyle \frac{5}{2}; change the sign. Check: 0.4 \cdot (-2.5) = -1.
- There is no such slope: the perpendicular is vertical. A slope of 0 is a horizontal line, and 0 has no reciprocal.
- Perpendicular. \displaystyle 4 \cdot \left(-\frac{1}{4}\right) = -1.
- Not perpendicular. \displaystyle \frac{3}{2} \cdot \frac{2}{3} = 1, not -1. The slopes are reciprocals, but both lines rise.
- Perpendicular. The slopes are \displaystyle \frac{1}{2} (from \displaystyle y = \frac{1}{2}x - 3) and -2 (from y = -2x + 1), and \displaystyle \frac{1}{2} \cdot (-2) = -1.
- Not perpendicular. The slopes are \displaystyle -\frac{3}{4} and \displaystyle -\frac{4}{3}, whose product is 1. Both lines fall.
- Perpendicular. y = 5 is horizontal and x = -2 is vertical. The product test cannot be used, since the vertical line has no slope.
- Perpendicular. The slopes are \displaystyle \frac{7 - 1}{2 - (-1)} = 2 and \displaystyle \frac{0 - 3}{6 - 0} = -\frac{1}{2}, and \displaystyle 2 \cdot \left(-\frac{1}{2}\right) = -1.
- Right angle at B. The slope of AB is \displaystyle \frac{2}{4} = \frac{1}{2}, of BC is \displaystyle \frac{8 - 2}{1 - 4} = -2, and of AC is \displaystyle \frac{8}{1} = 8. Only AB and BC have slopes that multiply to -1. Check: AB^2 + BC^2 = 20 + 45 = 65 = AC^2.
- No. The slope of PQ is \displaystyle \frac{1 - 3}{2 - (-1)} = -\frac{2}{3}, of QR is \displaystyle \frac{4 - 1}{5 - 2} = 1, and of PR is \displaystyle \frac{4 - 3}{5 - (-1)} = \frac{1}{6}. Their products in pairs are \displaystyle -\frac{2}{3}, \displaystyle -\frac{1}{9} and \displaystyle \frac{1}{6}, none of them -1. Check: PQ^2 = 13, QR^2 = 18 and PR^2 = 37, and no two of these add to the third.
- It is a rectangle, and a square. The slope of AB is \displaystyle \frac{2}{4} = \frac{1}{2}, of BC is \displaystyle \frac{7 - 3}{3 - 5} = -2, of CD is \displaystyle \frac{5 - 7}{-1 - 3} = \frac{1}{2}, and of DA is \displaystyle \frac{1 - 5}{1 - (-1)} = -2. Opposite sides are parallel and neighboring slopes multiply to -1, so it is a rectangle. Also AB^2 = 4^2 + 2^2 = 20 and BC^2 = (-2)^2 + 4^2 = 20, so neighboring sides are equal and the rectangle is a square.
- Yes. EG has slope \displaystyle \frac{4}{4} = 1 and FH has slope \displaystyle \frac{3 - 1}{1 - 3} = -1, and 1 \cdot (-1) = -1. All four sides have length \displaystyle \sqrt{10}, so EFGH is a rhombus.
- \displaystyle k = -\frac{1}{6}. The product 6k must be -1.
- \displaystyle a = \frac{5}{4}. The slope of ax + 5y = 2 is \displaystyle -\frac{a}{5}, and \displaystyle -\frac{a}{5} \cdot 4 = -1 gives 4a = 5.
- t = 3. The line needs slope \displaystyle \frac{1}{2}, the negative reciprocal of -2. So \displaystyle \frac{5 - t}{6 - 2} = \frac{1}{2}, which gives 5 - t = 2.
- k = 3 or \displaystyle k = \frac{1}{3}. The slopes are k and \displaystyle \frac{3k - 10}{3}. Setting \displaystyle k \cdot \frac{3k - 10}{3} = -1 gives 3k^2 - 10k + 3 = 0, which factors as (3k - 1)(k - 3) = 0. Check: k = 3 gives slopes 3 and \displaystyle -\frac{1}{3}, and \displaystyle k = \frac{1}{3} gives \displaystyle \frac{1}{3} and -3.
- a = 2. OA has slope \displaystyle \frac{1}{2}, so AP needs slope -2: \displaystyle \frac{6 - 2}{a - 4} = -2 gives a - 4 = -2. The value a = 4 would make AP vertical, which is not perpendicular to OA. Check: OA^2 + AP^2 = 20 + 20 = 40 = OP^2.
- Neither line is vertical, since each has a slope, so the product test applies. Two positive slopes have a positive product, and a positive number is never -1. In the picture, both lines rise to the right, while a quarter turn of a rising line gives a falling one.
- Neither p nor q is vertical, because a vertical line is perpendicular only to horizontal lines and \ell has slope m \ne 0. So each has a slope, and by the slope test that slope times m is -1. Both slopes therefore equal \displaystyle -\frac{1}{m}, and two lines with the same slope are parallel or are the same line.
- If A and B are both nonzero, the slopes are \displaystyle -\frac{A}{B} and \displaystyle \frac{B}{A}, and \displaystyle -\frac{A}{B} \cdot \frac{B}{A} = -1. If B = 0, then A \ne 0: the first line, Ax = C, is vertical and the second, -Ay = D, is horizontal. If A = 0, then B \ne 0: the first line, By = C, is horizontal and the second, Bx = D, is vertical. In every case the lines are perpendicular.
- No. 0.33 \cdot (-3) = -0.99, which is not -1, so the lines are not perpendicular, though they come close. A perpendicular pair would be \displaystyle \frac{1}{3} and -3, and 0.33 is not \displaystyle \frac{1}{3}.