When given two points, (x
1, y
1) and (x
2, y
2), a right triangle can be constructed with verticies ABC where A = (x
1, y
1),
B = (x
2, y
1), and C = (x
2, y
2). The length of the side AB will be (x
2 - x
1), and the length of BC will be
(y
2 - y
1). Using the Pythagorean Theorem we can relate the lengths as:
AC 2 =
AB 2 +
BC 2
AC 2 = (x
2 - x
1)
2 + (y
2 - y
1)
2
AC = √
(x2 - x1)2 + (y2 - y1)2
Since
AC describes the distance from (x
1, y
1) to (x
2, y
2), the equation can be used to find the
distance between any two points.
Another useful formula is for finding the midpoint of a line segment. The midpoint's coordinates will be the averages of the coordinates of the endpoints, or more precisely for a line
segment with endpoints (x
1, y
1) and (x
2, y
2), the midpoint will be:
(
)