Unizor - Math Concepts - Coordinates - Distance on a Plane
Channel: Zor Shekhtman on UNIZOR Education
Date: 02/08/2013

Let's assume that on a given plane with Cartesian coordinates we have two points - A at coordinates (xA,yA) and B at coordinates (xB,yB).
What's the distance between these two points expressed as a function of their coordinates?

The formula for a distance d between A(xA,yA) and B(xB,yB) is:
d² = (xA−xB)² + (yA−yB)²

Proof
Drop a perpendicular from A to X-axis. Let Ax be a projection point.
Drop a perpendicular from A to Y-axis. Let Ay be a projection point.
Drop a perpendicular from B to X-axis. Let Bx be a projection point.
Drop a perpendicular from B to Y-axis. Let By be a projection point.

Observe the following correspondence between coordinates of points A and B and segments constructed by making the above projections:
AAx = AyO = |yA|
AAy = AxO = |xA|
BBx = ByO = |yB|
BBy = BxO = |xB|
For now assume that all projection points are different. Special cases when some of them coincide will be considered later on.
Quadrilaterals AAxOAy and BBxOBy are obviously rectangles.
Let M be an intersection of lines AAx and BBy (extended if necessary).
Three points A, B and M form a right triangle because AAx is perpendicular to BBy.
The length of cathetus AM equals to the length of segment AyBy, that is a distance along the Y-axis between point Ay with coordinate yA and point By with coordinate yB. From a formula for a distance between two points on a coordinate line this distance equals to |yA−yB|.
The length of cathetus BM equals to the length of segment AxBx, that is a distance along the X-axis between point Ax with coordinate xA and point Bx with coordinate xB. From a formula for a distance between two points on a coordinate line this distance equals to |xA−xB|.
Since AB is a hypotenuse in the right triangle ΔABM, we can use the Pythagorean Theorem:
d² = (xA−xB)² + (yA−yB)²,
which is what we wanted to prove.

Let's complete our proof by considering special cases when we cannot construct a triangle ΔABM.
If xA and xB coincide, xA = xB, a segment AB is stretched parallel to the Y-axis. Therefore, its length equals to |yA−yB|, while |xA−xB| = 0. In this case d = |yA−yB| and our formula is obviously correct.
Similar situation can be observed if yA and yB coincide and our segment is stretched parallel to X-axis. It's length would be equal to |xA−xB|, while |yA−yB| = 0, which also satisfies the formula.
Case when projections on both axes coincide is not necessary to consider separately as it can be considered within frameworks of any one of two special cases presented above.
End of Proof.