Coordinates and distances on a plane
Distance between two points and the midpoint of a line segment
Distance between two points
For A(xA; yA) and B(xB; yB), the distance AB is calculated using the Pythagorean theorem applied to the differences in coordinates:
AB = √((xB - xA)² + (yB - yA)²)
Example: A(1; 2), B(4; 6). We calculate AB = √((4-1)² + (6-2)²) = √(9 + 16) = √(25) = 5.
Midpoint of a line segment
The midpoint I of the line segment [AB] has coordinates equal to the average of the coordinates of A and B:
xI = (xA + xB) / 2 and yI = (yA + yB) / 2
Example: given A(1; 2) and B(4; 6), we obtain xI = (1+4)/2 = 2.5 and yI = (2+6)/2 = 4, so I(2.5; 4).
Summary table
| Formula | Expression |
|---|---|
| Distance AB | sqrt((xB-xA)^2 + (yB-yA)^2) |
| Midpoint I of [AB] | ((xA + xB)/2; (yA + yB)/2) |
Pitfalls to avoid
- Do not forget the square brackets: we calculate (xB – xA)², never xB² – xA².
- The result of a distance calculation is always positive or zero (it is a square root).
- To find the midpoint, add the coordinates together and then divide by 2; under no circumstances should you subtract them.

