Introduction to Distance Between Two Points on a Graph
Whenever you can, count.
—Sir Francis Galton (1822–1911) English Geneticist and Statistician
In this lesson, you'll learn how to find the distance between two points on a graph by counting, using the Pythagorean theorem, and using the distance formula.
A line on the coordinate plane continues forever in both directions, but we can find the distance between two points on the line. When the points are on a horizontal line, such as y = 3, we can simply count the units from one point to the other.
What is the distance from point (–5,3) to point (7,3)? We can count the unit boxes between the two points. There are 12 units from (–5,3) to (7,3), which means that the distance between the points is 12 units.
Tip:
If the y values of two points are the same, the distance between the two points is equal to the difference between their x values. If the x values of two points are the same, the distance between the two points is equal to the difference between their y values.

The distance between (5,4) and (5,–10) is 14 units, because the x values of the points are the same, and 4 – (–10) = 14 units.
Often though, we need to find the distance between two points that are not on a horizontal or vertical line. For instance, how can we find the distance between two points on the line y = x?
Pythagorean Theorem
The Pythagorean theorem describes the relationship between the sides of a right triangle. It states that the sum of the squares of the bases of the triangle is equal to the square of the hypotenuse of the triangle: a^{2} + b^{2} = c^{2}. What is a triangle formula doing in a lesson about the distance between two points on a line? Drawing a triangle on a graph can help us find the distance between two points.
The following graph shows the line y = + 2, which contains the points (3,6) and (6,10).
We can't find the distance between these points just by counting. However, we can draw a vertical line down from (6,10) and a horizontal line from (3,6). These points meet at (6,6) and form a right triangle.
The bases of the triangle are the line segment from (3,6) to (6,6) and the line segment from (6,6) to (6,10). Because a horizontal line connects (3,6) to (6,6), we can find its length just by counting. The length of this line is 3 units. In the same way, the distance from (6,6) to (6,10) is 4 units. Now that we know the length of each base of the triangle, we can use the Pythagorean theorem to find the length of the hypotenuse of the triangle. In the formula a^{2} + b^{2} = c^{2}, a and b are the bases. Substitute 3 for a and 4 for b:
3^{2} + 4^{2} = c^{2}
9 + 16 = c^{2}
25 = c^{2}
To find the value of c, take the square root of both sides of the equation. A distance can never be negative, so we only need the positive square root of 25, which is 5. The distance between (3,6) and (6,10) is 5 units.
You might be thinking, "I don't want to draw a triangle every time I need to find the distance between two points." Well, let's look at exactly how we found the distance between (3,6) and (6,10). First, we added a point to the graph to form a triangle. The point represented the difference in the x values between the points (3 units, from 3 to 6) and the difference in the y values between the points (4 units, from 6 to 10). Then, we squared those differences, added them, and took the square root. To make finding distance easier, we can write these steps as a formula: the distance formula.
The distance formula states that D = √(x_{2} – x_{1})2 + (y_{2} – y_{1})2. That doesn't look much easier, so let's break the formula down into pieces. We want to find the distance from point 1, (3,6) and point 2, (6,10). To find the difference between the x values of the points, we subtract the first x value, which we can write as x_{1}, from the second x value, which we can write as x_{2}. To find the difference between the y values of the points, we subtract the first y value, y_{1}, from the second y value, y_{2}.
Difference between the x values: (x_{2} – x_{1}) = (6 – 3) = 3
Difference between the y values: (y_{2} – y_{1}) = (10 – 6) = 4
Now that we have the differences between each value, we square them and add them. This is the part of the formula that comes from the Pythagorean theorem. The square of 3 is 9 and the square of 4 is 16, and 9 + 16 = 25.
Finally, this sum is equal to the square of the distance between the two points, so to find the distance, we must take the square root of the sum: √25 = 5. Now, not only do you know how to use the distance formula, you know where it comes from!
Example
Find the distance between (–2,4) and (3,16).
We will call (–2,4) point 1 and (3, 16) point 2. Substitute these values into the distance formula: D = √(x_{2} – x_{1})2 + (y_{2} – y_{1})2. Because (–2,4) is the first point, x_{1} is –2 and y_{1} is 4. The value of x_{2} is 3 and the value of y_{2} is 16:
D = √3 – (–2))2 + (16 – 4)2
Remember the order of operations: parentheses come before exponents, so perform the subtraction first:
D = √(5)2 + (12)2
Exponents come before addition, so square 5 and 12 next:
D = √25 + 144
D = √169
D = 13 units
The distance between (–2,4) and (3,16) is 13 units.
Radical Distances
Sometimes, the distance between two points is not a whole number, and we are left with a radical. Let's find the distance between (1,2) and (7,12). Enter the x and y values of each point into the distance formula:
D = √(7 – 1)2 + (12 – 1)2
D = √(6)2 + (10)2
D = √36 + 100
D = √139
The number 136 is not a perfect square. When the distance formula leaves you with a radical like this, the only way to simplify it is to factor out a perfect square. Check to see if the radicand is divisible by 4, 9, 25, or some other square. The number 136 is divisible by 4, which means that √136 is divisible by √4: √136 = √4√34, because we can factor a radicand into two radicands in the same way that we factor a whole number into two whole numbers. The square root of 4 is 2, so √4√34 is equal to 2√34. The distance between (1,2) and (7,12) is 2√34 units.
Let's look at one last example: the distance between (2,1) and (–2,10). Enter the x and y values of each point into the distance formula:
D = √((–2)– 2)2 + (10 – 1)2
D = √(–4)2 + (9)2
D = √16 + 81
D = √97
The number 97 is not divisible by any whole number perfect square (4, 25, 36, 49, 64, or 81), so √97 cannot be simplified. The distance between (2,1) and (–2,10) is √97 units.
Find practice problems and solutions for these concepts at Distance Between Two Points on a Graph Practice Questions.