Sub topic 11
The perpendicular bisector of a segment
Prerequisites
This chapter assumes you can do the following:
- Compute the slope of a line from two points.
- Write a line in point-slope and slope-intercept form.
- Find the negative reciprocal of a slope.
- Handle vertical and horizontal lines as special cases.
- Do fraction arithmetic.
If any of these feel shaky, review the earlier chapters on slope, line equations, and special cases first.
What a perpendicular bisector is
A segment has two endpoints, A and B. The perpendicular bisector of segment AB is the line that does two things at once:
- It passes through the midpoint of AB. This is the "bisector" part: it cuts the segment into two equal halves.
- It is perpendicular to AB. This is the "perpendicular" part: it meets the segment at a right angle.
Each condition alone is not enough. Many lines pass through the midpoint, and many lines are perpendicular to AB. Only one line satisfies both.
That uniqueness is what makes the construction work in algebra. A line needs a point and a slope. The midpoint supplies the point. The negative reciprocal of the segment's slope supplies the slope.
Step 1: the midpoint
The midpoint of a segment with endpoints (x1, y1) and (x2, y2) is the average of the coordinates:
M = ((x1 + x2) / 2, (y1 + y2) / 2)
Averaging works because the midpoint is equally far from both ends along each axis. Moving from A to M changes x by half of the total change in x, and y by half of the total change in y.
Step 2: the perpendicular slope
Find the slope of AB:
m = (y2 - y1) / (x2 - x1)
The perpendicular bisector has slope -1/m. Two special cases need separate handling:
| Segment AB is | Slope of AB | Perpendicular bisector is |
|---|---|---|
| Horizontal (y1 = y2) | 0 | Vertical line x = midpoint x |
| Vertical (x1 = x2) | Undefined | Horizontal line y = midpoint y |
| Neither | m (nonzero) | Line with slope -1/m through M |
The negative reciprocal formula fails for a horizontal segment because it would divide by zero. Use the table instead.
Step 3: write the line
Use point-slope form with the midpoint (xm, ym) and the new slope m_perp:
y - ym = m_perp (x - xm)
Then rearrange to slope-intercept form if you want y = mx + b.
Worked example
Find the perpendicular bisector of the segment with endpoints A(1, 2) and B(5, 6).
Midpoint.
M = ((1 + 5) / 2, (2 + 6) / 2) = (3, 4)
Slope of AB.
m = (6 - 2) / (5 - 1) = 4/4 = 1
Perpendicular slope.
m_perp = -1/1 = -1
Equation. Use point-slope form with M(3, 4):
y - 4 = -1(x - 3) y - 4 = -x + 3 y = -x + 7
Check. The line y = -x + 7 should pass through M: at x = 3, y = -3 + 7 = 4. It does. The slopes 1 and -1 multiply to -1, so the lines are perpendicular.
A second example with fractions
Find the perpendicular bisector of A(-2, 1) and B(4, 4).
Midpoint: ((-2 + 4) / 2, (1 + 4) / 2) = (1, 5/2).
Slope of AB: (4 - 1) / (4 - (-2)) = 3/6 = 1/2.
Perpendicular slope: -2.
Point-slope form: y - 5/2 = -2(x - 1).
Expand: y - 5/2 = -2x + 2, so y = -2x + 9/2.
Check the midpoint: -2(1) + 9/2 = 5/2. Correct.
Fractions are common in this type of problem. Keep them exact rather than converting to decimals, as the code below does.
Code
The following function takes two endpoints and returns the perpendicular bisector. It uses Fraction so the arithmetic stays exact. For the two non-sloped cases it returns a description of the vertical or horizontal line.
from fractions import Fraction
def perpendicular_bisector(p, q):
(x1, y1), (x2, y2) = p, q
if (x1, y1) == (x2, y2):
raise ValueError("endpoints must be different points")
xm = Fraction(x1 + x2, 2)
ym = Fraction(y1 + y2, 2)
if y1 == y2: # horizontal segment
return ("vertical", xm) # line x = xm
if x1 == x2: # vertical segment
return ("horizontal", ym) # line y = ym
m = Fraction(y2 - y1, x2 - x1)
m_perp = -1 / m
b = ym - m_perp * xm
return ("sloped", m_perp, b) # line y = m_perp * x + b
print(perpendicular_bisector((1, 2), (5, 6))) # ('sloped', Fraction(-1, 1), Fraction(7, 1))
print(perpendicular_bisector((-2, 1), (4, 4))) # ('sloped', Fraction(-2, 1), Fraction(9, 2))
print(perpendicular_bisector((0, 3), (6, 3))) # ('vertical', Fraction(3, 1))
print(perpendicular_bisector((2, -1), (2, 5))) # ('horizontal', Fraction(2, 1))The function rejects identical endpoints. A single point has no direction, so it has no perpendicular bisector.
Why every point on the bisector is equidistant from the endpoints
There is a second description of the perpendicular bisector, and it is often more useful in proofs and in problems about "points equally far from A and B."
Theorem. A point P lies on the perpendicular bisector of AB if and only if PA = PB.
You can see this in algebra. Let P = (x, y). Setting PA² = PB² gives:
(x - x1)² + (y - y1)² = (x - x2)² + (y - y2)²
Expand both sides. The x² and y² terms cancel, leaving a linear equation:
2(x2 - x1)x + 2(y2 - y1)y = x2² + y2² - x1² - y1²
The coefficients of x and y are proportional to (x2 - x1, y2 - y1), which is the direction of AB. A line with that normal direction is perpendicular to AB. Substituting the midpoint into the equation confirms that it satisfies it. So the set of equidistant points is exactly the perpendicular bisector.
This gives you a second method. For A(1, 2) and B(5, 6):
(x - 1)² + (y - 2)² = (x - 5)² + (y - 6)²
x² - 2x + 1 + y² - 4y + 4 = x² - 10x + 25 + y² - 12y + 36
-2x - 4y + 5 = -10x - 12y + 61
8x + 8y = 56
x + y = 7
This is the same line as y = -x + 7. The distance method avoids slopes entirely, so it handles horizontal and vertical segments with no special cases.
Common errors
- Using the segment's slope instead of its negative reciprocal. The bisector is perpendicular, so its slope is -1/m, not m.
- Forgetting to negate. The reciprocal alone gives 1/m, which is wrong. Both the sign flip and the reciprocal are needed.
- Using an endpoint instead of the midpoint. A line through A with slope -1/m is perpendicular to AB but does not bisect it.
- Subtracting coordinates in the midpoint formula. The midpoint averages the coordinates, so add them and then divide by 2.
- Mixing the order of subtraction in the slope. Compute y2 - y1 and x2 - x1 in the same order. Swapping only one flips the sign of the slope.
- Dividing by zero for horizontal segments. If the segment is horizontal, the perpendicular slope is undefined, and the bisector is a vertical line.
Applications
Perpendicular bisectors show up in several places:
- Circumcenter of a triangle. The perpendicular bisectors of the three sides meet at one point. That point is equally far from all three vertices, so it is the center of the circle through them.
- Nearest-site problems. The bisector between two sites separates the points closer to one from the points closer to the other. This is the building block of Voronoi diagrams.
- Reflection. Reflecting a point A across a line L gives a point B such that L is the perpendicular bisector of AB.
As a small example of the circumcenter idea, find the point equidistant from (0, 0), (4, 0), and (0, 4). The bisector of the first two points is x = 2 (vertical, since the segment is horizontal). The bisector of the first and third is y = 2. They meet at (2, 2). The distance from (2, 2) to each vertex is the square root of 8, so the check passes.
Exercises
Exercise
Find the equation of the perpendicular bisector of the segment with endpoints A(-3, 2) and B(5, 6).
Show answer
The midpoint is ((-3 + 5)/2, (2 + 6)/2) = (1, 4). The slope of AB is (6 - 2)/(5 - (-3)) = 4/8 = 1/2, so the perpendicular slope is -2. Point-slope form gives y - 4 = -2(x - 1), so y = -2x + 6. Check: at x = 1, y = 4, which is the midpoint.
Exercise
Find the perpendicular bisector of the segment with endpoints (2, -1) and (2, 7). Then explain why the usual negative reciprocal step cannot be used.
Show answer
The segment is vertical because both x-coordinates are 2. The midpoint is (2, 3). A line perpendicular to a vertical line is horizontal, so the bisector is y = 3. The slope of the segment is undefined (division by zero), so there is no number to take the negative reciprocal of. The table of special cases gives the answer directly.
Exercise
Use the equidistance method to find the set of points equally far from (0, 0) and (6, 2). Give the result in the form Ax + By = C.
Show answer
Set x² + y² = (x - 6)² + (y - 2)². Expanding the right side gives x² - 12x + 36 + y² - 4y + 4. The x² and y² terms cancel, leaving 0 = -12x - 4y + 40, so 12x + 4y = 40, or 3x + y = 10. Check: the midpoint (3, 1) gives 9 + 1 = 10. The segment has slope 1/3 and the line has slope -3, which are negative reciprocals.
Exercise
A student finds the perpendicular bisector of A(0, 0) and B(4, 2) as y - 1 = 2(x - 2). Identify the mistake and give the correct line.
Show answer
The student used the slope 2 instead of the negative reciprocal. The slope of AB is 2/4 = 1/2, so the perpendicular slope is -2, not 2. The midpoint (2, 1) is correct. The correct line is y - 1 = -2(x - 2), which simplifies to y = -2x + 5.