Lengths And Midpoints Of Line Segments
Theory
The length of a line segment is the distance between its endpoints, found with Pythagoras’ theorem or the distance formula, and its midpoint is found by averaging the coordinates. This Year 11 Mathematics Advanced page covers exact (surd) and rounded lengths, horizontal and vertical distances, perimeters, finding an endpoint from the midpoint, and finding an unknown coordinate from a given length or midpoint.
A line segment (or interval) \(AB\) is the part of a line between the two endpoints \(A\) and \(B\). Its length is the distance \(AB\) between the endpoints.
Going from \(A(x_1,y_1)\) to \(B(x_2,y_2)\), the horizontal change is the run \(x_2-x_1\) and the vertical change is the rise \(y_2-y_1\). The segment \(AB\) is the hypotenuse of a right-angled triangle with these two sides, so Pythagoras’ theorem gives \(AB^2=\text{run}^2+\text{rise}^2\). Written with coordinates, this is the distance formula.
If the two points have the same \(x\)-coordinate, the segment is vertical and its length is the difference of the \(y\)-coordinates. If they have the same \(y\)-coordinate, it is horizontal and its length is the difference of the \(x\)-coordinates.
The midpoint \(M\) of \(AB\) is the point halfway between \(A\) and \(B\). Its \(x\)-coordinate is the average of the two \(x\)-coordinates and its \(y\)-coordinate is the average of the two \(y\)-coordinates.
A length asked for exactly is left as a surd in simplest form, such as \(\sqrt{45}=3\sqrt{5}\). Otherwise round to the number of decimal places asked for, and give the units.
For the points \(A(x_1,y_1)\) and \(B(x_2,y_2)\):
Without the square root, the formula gives the square of the length, which is useful when \(AB^2\) is asked for or when the length is known and a coordinate is unknown:
How to find the length of a segment
- Label the points \((x_1,y_1)\) and \((x_2,y_2)\). Either point can be first.
- Substitute into the distance formula, with brackets around negative numbers.
- Simplify: square, add, then take the square root. Simplify the surd for an exact answer, or round as asked, with units.
The same working can be set out as run and rise: run \(=x_2-x_1\), rise \(=y_2-y_1\), then \(d^2=\text{run}^2+\text{rise}^2\).
How to find a midpoint
- Add the two \(x\)-coordinates and halve.
- Add the two \(y\)-coordinates and halve.
- Write the answer as a point, \(M(x,y)\).
Working backwards
- Endpoint from the midpoint: write \(\dfrac{x_A+x_B}{2}=x_M\) and \(\dfrac{y_A+y_B}{2}=y_M\). Multiply each by \(2\) and solve (Example 3).
- Unknown coordinate from a length: substitute into the distance formula, square both sides and solve. A squared bracket equal to a positive number gives two answers, \(\pm\) (Example 4).
- Perimeter: find each side length and add. Keep surds or full calculator values until the final rounding.
(i) exactly, in simplest surd form
(ii) correct to 1 decimal place.
Let \(x_1=-1,\ y_1=4\) and \(x_2=3,\ y_2=-2\).
| \(d\) | \(=\) | \(\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\) |
| \(\) | \(=\) | \(\sqrt{(3-(-1))^2+(-2-4)^2}\) |
| \(\) | \(=\) | \(\sqrt{4^2+(-6)^2}\) |
| \(\) | \(=\) | \(\sqrt{16+36}\) |
| \(\) | \(=\) | \(\sqrt{52}\) |
(i) \(52=4\times 13\), so \(\sqrt{52}=\sqrt{4}\times\sqrt{13}\).
\(\therefore\) \(PQ=\boldsymbol{2\sqrt{13}}\) units
(ii) \(\sqrt{52}=7.2111\ldots\)
\(\therefore\) \(PQ\approx\boldsymbol{7.2}\) units
Average the \(x\)-coordinates and average the \(y\)-coordinates.
| \(x\) | \(=\) | \(\dfrac{-4+3}{2}=-\dfrac{1}{2}\) |
| \(y\) | \(=\) | \(\dfrac{1+6}{2}=\dfrac{7}{2}\) |
\(\therefore\) \(\boldsymbol{M\left(-\dfrac{1}{2},\dfrac{7}{2}\right)}\)
Check on the graph: \(M\) sits halfway along \(AB\), between \(x=-4\) and \(x=3\) and between \(y=1\) and \(y=6\).
Let \(B(x_B,y_B)\). Write the midpoint formula for each coordinate and solve.
| \(\dfrac{-3+x_B}{2}\) | \(=\) | \(2\) |
| \(-3+x_B\) | \(=\) | \(4\) |
| \(x_B\) | \(=\) | \(7\) |
| \(\dfrac{4+y_B}{2}\) | \(=\) | \(-1\) |
| \(4+y_B\) | \(=\) | \(-2\) |
| \(y_B\) | \(=\) | \(-6\) |
\(\therefore\) \(\boldsymbol{B(7,-6)}\)
Check: from \(A\) to \(M\) is \(5\) right and \(5\) down; the same step again from \(M\) lands on \(B(7,-6)\).
Substitute into the distance formula and square both sides.
| \(\sqrt{(3-k)^2+(4-(-1))^2}\) | \(=\) | \(13\) |
| \((3-k)^2+25\) | \(=\) | \(169\) |
| \((3-k)^2\) | \(=\) | \(144\) |
| \(3-k\) | \(=\) | \(\pm 12\) |
\(3-k=12\Rightarrow k=-9\); \(3-k=-12\Rightarrow k=15\)
\(\therefore\) \(\boldsymbol{k=-9}\) or \(\boldsymbol{k=15}\)
Both answers work: \(P\) can be \(13\) units to the left or to the right of \(Q\) along the line \(y=-1\). Check \(P(15,-1)\): \(\sqrt{12^2+5^2}=\sqrt{169}=13\).
Common pitfalls
Frequently asked questions
How do you find the distance between two points?
Subtract the \(x\)-coordinates and subtract the \(y\)-coordinates, square both differences, add them, and take the square root: \(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\). This comes from Pythagoras’ theorem.
How do you find the midpoint of a line segment?
Add the two \(x\)-coordinates and halve, then add the two \(y\)-coordinates and halve. The midpoint of \((2,3)\) and \((6,9)\) is \((4,6)\).
How do you find an endpoint if you know the midpoint?
Write \(\dfrac{x_A+x_B}{2}=x_M\) and \(\dfrac{y_A+y_B}{2}=y_M\), multiply by \(2\) and solve. In effect, the endpoint is twice the midpoint minus the known endpoint, one coordinate at a time.
Does it matter which point is (x1, y1) in the distance formula?
No. Swapping the points only changes the sign of each difference, and the differences are squared, so the distance is the same. The midpoint is the same either way too.
How do you give an exact distance?
Leave the answer as a square root and simplify it by taking out the largest square factor: \(\sqrt{45}=\sqrt{9\times 5}=3\sqrt{5}\).