Sub topic 11
Finding a Midpoint
Prerequisites and the main idea
This chapter assumes you can read ordered pairs, use positive and negative numbers, add and subtract integers, and divide by 2. You should also know that a point is written as \((x, y)\), where \(x\) gives horizontal position and \(y\) gives vertical position.
The midpoint of a segment is the point exactly halfway between its two endpoints. On a coordinate plane, find it by averaging the two x-coordinates and averaging the two y-coordinates:
\[ M=\left(\frac{x1+x2}{2},\frac{y1+y2}{2}\right) \]
The midpoint formula works because halfway between two numbers is their average.
A guided example
Let the endpoints be \(A=(-3, 4)\) and \(B=(5, -2)\).
First, average the x-coordinates:
\[ x_M=\frac{-3+5}{2}=\frac{2}{2}=1 \]
Next, average the y-coordinates:
\[ y_M=\frac{4+(-2)}{2}=\frac{2}{2}=1 \]
Therefore, the midpoint is:
\[ M=(1,1) \]
The midpoint has an x-coordinate halfway between \(-3\) and \(5\), and a y-coordinate halfway between \(4\) and \(-2\).
| Coordinate | Endpoint A | Endpoint B | Average |
|---|---|---|---|
| x | -3 | 5 | 1 |
| y | 4 | -2 | 1 |
Horizontal and vertical segments
For a horizontal segment, both endpoints have the same y-coordinate. The midpoint keeps that y-coordinate and averages the x-coordinates.
For example, the midpoint of \((-6, 2)\) and \((4, 2)\) is:
\[ \left(\frac{-6+4}{2},\frac{2+2}{2}\right)=(-1,2) \]
For a vertical segment, both endpoints have the same x-coordinate. The midpoint keeps that x-coordinate and averages the y-coordinates.
For example, the midpoint of \((3,-5)\) and \((3,7)\) is:
\[ \left(\frac{3+3}{2},\frac{-5+7}{2}\right)=(3,1) \]
The midpoint can have fractional or decimal coordinates. For endpoints \((1,2)\) and \((4,7)\), the midpoint is:
\[ \left(\frac{1+4}{2},\frac{2+7}{2}\right)=\left(2.5,4.5\right) \]
A midpoint function in Python
The function below averages corresponding coordinates. A tuple is a small ordered collection, so each point is stored as two values.
def midpoint(p, q):
return ((p[0] + q[0]) / 2, (p[1] + q[1]) / 2)
a = (-3, 4)
b = (5, -2)
print(midpoint(a, b))The output is:
(1.0, 1.0)The values appear as decimals because Python uses division to calculate the averages.
Common errors
- Averaging the x-coordinate of one point with the y-coordinate of the other. Always average corresponding coordinates.
- Forgetting that a negative number remains negative. For example, \(4+(-2)=2\), not \(6\).
- Dividing only one coordinate by 2. Both coordinate sums must be divided by 2.
- Reversing the order of a coordinate. The first result is x, and the second result is y.
- Assuming the midpoint must have integer coordinates. Fractions and decimals are valid.
Exercise
Find the midpoint of the segment with endpoints (-8, 3) and (2, -5).
Show answer
Average the corresponding coordinates: ((-8 + 2) / 2, (3 + -5) / 2) = (-3, -1). The midpoint is (-3, -1).