The distance formula is one of the most useful formulas in coordinate geometry. It helps us find the exact distance between any two points on a coordinate plane when their coordinates are known. Instead of measuring the distance directly with a ruler, we can use the coordinates of the two points and calculate the distance mathematically.
The distance formula is based on the Pythagorean theorem. When two points are joined, the horizontal and vertical differences between their coordinates form the two perpendicular sides of a right triangle. The distance between the points becomes the hypotenuse of that triangle. This connection makes the formula easy to understand and apply.
In this article, we will learn the distance formula, understand how it is derived, solve different types of examples, and see how it can be used to determine distances between points on the coordinate plane.
What Is the Distance Formula?
Suppose two points on a coordinate plane are given as:
A(x₁, y₁) and B(x₂, y₂)
The distance between these two points is given by the distance formula:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Here:
d = distance between the two points
x₁, y₁ = coordinates of the first point
x₂, y₂ = coordinates of the second point
x₂ − x₁ = difference between the x-coordinates
y₂ − y₁ = difference between the y-coordinates
The formula works for points in any position on a two-dimensional Cartesian coordinate plane.
Understanding the Coordinate Plane
Before using the distance formula, it is important to understand the coordinate plane.
A Cartesian coordinate plane consists of two perpendicular number lines:
The horizontal line is called the x-axis.
The vertical line is called the y-axis.
The point where the two axes meet is called the origin, represented by (0, 0).
Every point on the coordinate plane is represented by an ordered pair:
(x, y)
The first number represents the horizontal position of the point, while the second number represents its vertical position.
For example, the point (4, 3) means that we move 4 units along the x-axis and then 3 units upward along the y-axis.
When two points are given, their coordinates allow us to calculate the horizontal and vertical changes between them. These changes are the key parts of the distance formula.
Distance Formula and the Pythagorean Theorem
The distance formula comes directly from the Pythagorean theorem.
The Pythagorean theorem states:
a² + b² = c²
where a and b are the two perpendicular sides of a right triangle and c is the hypotenuse.
Now consider two points:
A(x₁, y₁) and B(x₂, y₂)
Imagine drawing a horizontal line and a vertical line between these points. These lines create a right triangle.
The horizontal side has length:
x₂ − x₁
The vertical side has length:
y₂ − y₁
The distance between the two original points is the hypotenuse.
Therefore, according to the Pythagorean theorem:
d² = (x₂ − x₁)² + (y₂ − y₁)²
Taking the square root of both sides gives:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
This is the distance formula.
Derivation of the Distance Formula
Let the two points be:
A(x₁, y₁) and B(x₂, y₂)
The difference between their x-coordinates is:
Δx = x₂ − x₁
The difference between their y-coordinates is:
Δy = y₂ − y₁
These two differences represent the horizontal and vertical sides of a right triangle.
Using the Pythagorean theorem:
d² = (Δx)² + (Δy)²
Substituting the coordinate differences:
d² = (x₂ − x₁)² + (y₂ − y₁)²
Taking the positive square root:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Since distance cannot be negative, we use the positive square root.
Thus, the distance formula is derived from the Pythagorean theorem.
How to Use the Distance Formula
To find the distance between two points, follow these steps.
Step 1: Identify the coordinates
Write down the coordinates of the two points.
For example:
A(2, 3) and B(7, 6)
Therefore:
x₁ = 2, y₁ = 3
x₂ = 7, y₂ = 6
Step 2: Find the differences
Calculate the difference between the x-coordinates and y-coordinates:
x₂ − x₁ = 7 − 2 = 5
y₂ − y₁ = 6 − 3 = 3
Step 3: Square the differences
5² = 25
3² = 9
Step 4: Add the squares
25 + 9 = 34
Step 5: Take the square root
d = √34
Therefore, the distance between the two points is:
√34 units
Approximately:
5.83 units
Example 1: Distance Between Two Points
Find the distance between:
A(1, 2) and B(5, 5)
Using the distance formula:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Substitute the coordinates:
d = √[(5 − 1)² + (5 − 2)²]
Simplify:
d = √[4² + 3²]
d = √[16 + 9]
d = √25
Therefore:
d = 5 units
So, the distance between A(1, 2) and B(5, 5) is 5 units.
Example 2: Points With Negative Coordinates
Find the distance between:
P(−2, 3) and Q(4, −5)
Using the formula:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Substitute the values:
d = √[(4 − (−2))² + (−5 − 3)²]
Simplify:
d = √[6² + (−8)²]
d = √[36 + 64]
d = √100
Therefore:
d = 10 units
The distance between the two points is 10 units.
Example 3: Distance Between a Point and the Origin
Suppose a point is:
P(6, 8)
The origin is:
O(0, 0)
Using the distance formula:
d = √[(6 − 0)² + (8 − 0)²]
d = √[36 + 64]
d = √100
Therefore:
d = 10 units
This is also related to the familiar 6-8-10 right triangle.
For a point (x, y) and the origin (0, 0), the formula becomes:
d = √(x² + y²)
This is a useful special case of the distance formula.
Example 4: Distance Between Points With the Same x-Coordinate
Consider:
A(3, 2) and B(3, 9)
Both points have the same x-coordinate.
Using the distance formula:
d = √[(3 − 3)² + (9 − 2)²]
d = √[0² + 7²]
d = √49
d = 7 units
Because both points have the same x-coordinate, the line joining them is vertical. Therefore, the distance is simply the difference between their y-coordinates.
Example 5: Distance Between Points With the Same y-Coordinate
Consider:
P(−4, 6) and Q(5, 6)
Both points have the same y-coordinate.
Using the distance formula:
d = √[(5 − (−4))² + (6 − 6)²]
d = √[9² + 0²]
d = √81
d = 9 units
When two points have the same y-coordinate, the line joining them is horizontal. The distance is therefore the difference between their x-coordinates.
Why Are the Differences Squared?
A common question is why the distance formula contains squares.
Suppose the difference between two x-coordinates is negative. For example:
x₂ − x₁ = −5
If we used this value directly, it would affect the distance incorrectly. However, squaring it gives:
(−5)² = 25
The same idea applies to the y-coordinate difference.
Squaring makes both positive and negative coordinate differences contribute positively to the length of the right triangle’s sides.
After adding the squared values, we take the square root to obtain the actual distance.
Does the Order of the Points Matter?
No. The distance between two points remains the same regardless of which point is considered first.
For example, consider:
A(2, 3) and B(7, 6)
Using A first:
d = √[(7 − 2)² + (6 − 3)²]
Using B first:
d = √[(2 − 7)² + (3 − 6)²]
The second calculation gives:
d = √[(−5)² + (−3)²]
d = √[25 + 9]
d = √34
Both methods produce the same distance.
This happens because squaring removes the effect of the negative signs.
Distance Formula for Horizontal and Vertical Lines
The distance formula can be simplified in special situations.
Horizontal Distance
If two points have the same y-coordinate:
A(x₁, y) and B(x₂, y)
then:
d = |x₂ − x₁|
For example, the distance between (2, 4) and (9, 4) is:
d = |9 − 2| = 7 units
Vertical Distance
If two points have the same x-coordinate:
A(x, y₁) and B(x, y₂)
then:
d = |y₂ − y₁|
For example, the distance between (5, 1) and (5, 8) is:
d = |8 − 1| = 7 units
These are special cases of the general distance formula.
Distance Formula in Different Quadrants
The distance formula works regardless of which quadrant the points are located in.
The coordinate plane has four quadrants:
First quadrant: x is positive and y is positive.
Second quadrant: x is negative and y is positive.
Third quadrant: x is negative and y is negative.
Fourth quadrant: x is positive and y is negative.
When points lie in different quadrants, the coordinate differences may involve negative numbers. The formula still works because the differences are squared.
For example, consider:
A(−3, −2) and B(4, 4)
The distance is:
d = √[(4 − (−3))² + (4 − (−2))²]
d = √[7² + 6²]
d = √[49 + 36]
d = √85
Therefore, the distance is √85 units, or approximately 9.22 units.
Applications of the Distance Formula
The distance formula is not limited to textbook exercises. It has many applications in mathematics, science, engineering, computer graphics, navigation, and technology.
Finding the Length of a Line Segment
If the coordinates of the endpoints of a line segment are known, the distance formula gives its exact length.
Checking Geometric Shapes
Coordinates can be used to determine whether a shape has equal sides. For example, calculating the lengths of different sides can help identify squares, rectangles, rhombuses, or other geometric figures.
Finding the Diameter of a Circle
If two endpoints of a diameter are known, the distance formula can be used to calculate the diameter. Once the diameter is known, the radius can be found by dividing it by 2.
Coordinate Geometry
The distance formula is an important tool for solving problems involving triangles, quadrilaterals, circles, slopes, and other coordinate-based figures.
Computer Graphics
Computer systems use coordinate-based calculations to determine distances between objects and points. Similar distance calculations are used in graphics, simulations, games, and digital mapping.
Navigation and Mapping
Locations can be represented using coordinates, and mathematical distance calculations can help determine how far apart two locations are within a coordinate system.
Common Mistakes When Using the Distance Formula
Although the formula is straightforward, several mistakes can occur.
Mixing Up Coordinates
Remember that the first coordinate is always x and the second coordinate is y.
For a point (4, 7):
x = 4
y = 7
Do not reverse them.
Forgetting Parentheses With Negative Numbers
If a coordinate is negative, use parentheses when subtracting it.
For example:
5 − (−3)
not simply:
5 − −3
Writing the expression carefully helps avoid sign errors.
Forgetting to Square Both Differences
Both coordinate differences must be squared:
(x₂ − x₁)² + (y₂ − y₁)²
Do not square only one of them.
Forgetting the Square Root
After adding the squared differences, remember to take the square root.
For example:
d² = 25
does not mean the distance is 25.
The distance is:
d = √25 = 5
Giving a Negative Distance
Distance represents length, so it cannot be negative. If your final answer is negative, check the calculation.
Distance Formula vs. Midpoint Formula
The distance formula and midpoint formula are both important concepts in coordinate geometry, but they answer different questions.
The distance formula finds the length between two points:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
The midpoint formula finds the point exactly halfway between two points:
M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
For example, if two points are A(2, 4) and B(8, 10), the distance formula gives the length of segment AB, while the midpoint formula gives the coordinates of the point halfway between A and B.
Understanding the difference between these formulas is important when solving coordinate geometry problems.
Important Points to Remember
The following points summarize the main ideas about the distance formula:
The distance formula finds the distance between two coordinate points.
It is based on the Pythagorean theorem.
The general formula is d = √[(x₂ − x₁)² + (y₂ − y₁)²].
The x-coordinate difference represents horizontal change.
The y-coordinate difference represents vertical change.
Negative coordinate differences are squared, so they do not produce a negative distance.
The order of the two points does not change the distance.
If the points have the same x-coordinate, the distance is vertical.
If the points have the same y-coordinate, the distance is horizontal.
The formula works in all four quadrants of the coordinate plane.
Distance is always zero or positive.
The distance formula is widely used in coordinate geometry and other mathematical applications.
Conclusion
The distance formula provides a simple and reliable way to find the distance between two points on a coordinate plane. It is based on the Pythagorean theorem, where the horizontal and vertical differences between the coordinates form the two perpendicular sides of a right triangle.
For two points (x₁, y₁) and (x₂, y₂), the distance is:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Once the coordinates are substituted carefully, the calculation involves finding the differences, squaring them, adding the results, and taking the square root. With practice, the distance formula becomes a useful foundation for more advanced topics in coordinate geometry, including circles, triangles, slopes, and analytical geometry.
FAQs
1. What is the distance formula in coordinate geometry?
The distance formula is a mathematical formula used to find the distance between two points on a coordinate plane. If the two points are (x₁, y₁) and (x₂, y₂), the formula is d = √[(x₂ − x₁)² + (y₂ − y₁)²]. It calculates the straight-line distance between the two points. The formula is derived from the Pythagorean theorem because the horizontal and vertical differences between the coordinates form the two perpendicular sides of a right triangle. The distance between the points represents the hypotenuse of this triangle. It is widely used in coordinate geometry and related mathematical problems.
2. How is the distance formula derived?
The distance formula is derived using the Pythagorean theorem. Consider two points (x₁, y₁) and (x₂, y₂) on a coordinate plane. The horizontal difference between the points is x₂ − x₁, while the vertical difference is y₂ − y₁. These differences form the two perpendicular sides of a right triangle. According to the Pythagorean theorem, a² + b² = c². Therefore, d² = (x₂ − x₁)² + (y₂ − y₁)². Taking the square root of both sides gives d = √[(x₂ − x₁)² + (y₂ − y₁)²], which is the distance formula.
3. What does the distance formula calculate?
The distance formula calculates the straight-line distance between two points on a two-dimensional coordinate plane. It uses the x- and y-coordinates of both points to determine how far apart they are. The formula considers both horizontal and vertical changes between the points. For example, if two points are (2, 3) and (6, 6), their horizontal difference is 4 units and their vertical difference is 3 units. These form a right triangle, and the distance is the hypotenuse. Using the formula gives √(4² + 3²) = 5 units. Thus, the formula gives the shortest straight-line distance.
4. Why is the Pythagorean theorem used in the distance formula?
The Pythagorean theorem is used because the horizontal and vertical differences between two coordinate points form a right triangle. Suppose two points have coordinates (x₁, y₁) and (x₂, y₂). The horizontal change is x₂ − x₁, and the vertical change is y₂ − y₁. These two changes meet at a right angle. The original distance between the points is the hypotenuse of this right triangle. The Pythagorean theorem states that the square of the hypotenuse equals the sum of the squares of the other two sides. This directly produces the distance formula.
5. How do you find the distance between two points?
To find the distance between two points, first identify their coordinates. Suppose the points are A(x₁, y₁) and B(x₂, y₂). Substitute these coordinates into the distance formula d = √[(x₂ − x₁)² + (y₂ − y₁)²]. Next, calculate the difference between the x-coordinates and the difference between the y-coordinates. Square both differences, add them together, and then find the square root of the result. For example, between (1, 2) and (4, 6), the distance is √[(4 − 1)² + (6 − 2)²] = √25 = 5 units.
6. Can the distance formula be used with negative coordinates?
Yes, the distance formula can be used with negative coordinates. Points may be located in any of the four quadrants of the coordinate plane, and the formula works in all cases. When negative coordinates are involved, it is important to use parentheses correctly while subtracting. For example, for points (−2, 3) and (4, −5), the formula becomes d = √[(4 − (−2))² + (−5 − 3)²]. This simplifies to √(6² + (−8)²) = √100 = 10 units. Squaring the differences ensures that negative signs do not produce a negative distance.
7. Does the order of points matter in the distance formula?
No, changing the order of the two points does not change the distance between them. For example, consider the points A(2, 3) and B(7, 6). Using A as the first point gives √[(7 − 2)² + (6 − 3)²] = √34. Reversing the order gives √[(2 − 7)² + (3 − 6)²] = √34. The differences become negative when the order is reversed, but those differences are squared in the formula. Therefore, both calculations produce exactly the same result. Distance is independent of the order in which the two points are selected.
8. What happens when two points have the same x-coordinate?
When two points have the same x-coordinate, they lie on the same vertical line. In this situation, the horizontal difference is zero. For example, consider A(4, 2) and B(4, 9). Using the distance formula gives d = √[(4 − 4)² + (9 − 2)²] = √49 = 7 units. Therefore, when the x-coordinates are equal, the distance can simply be found by taking the absolute difference between the y-coordinates: d = |y₂ − y₁|. This is a special case of the general distance formula.
9. What happens when two points have the same y-coordinate?
When two points have the same y-coordinate, they lie on the same horizontal line. Therefore, the vertical difference between their coordinates is zero. For example, consider P(−3, 5) and Q(6, 5). Using the distance formula gives d = √[(6 − (−3))² + (5 − 5)²] = √81 = 9 units. In this situation, the distance can simply be calculated using the absolute difference between the x-coordinates: d = |x₂ − x₁|. This is a simplified form of the distance formula for horizontal line segments.
10. Where is the distance formula used in mathematics?
The distance formula is widely used in coordinate geometry and many other areas of mathematics. It can be used to calculate the length of line segments, verify whether geometric figures have equal sides, find the diameter of a circle when its endpoints are known, and solve problems involving triangles and quadrilaterals. It is also useful when studying circles, equations of geometric figures, and analytical geometry. Beyond mathematics, coordinate-based distance calculations are used in computer graphics, mapping, navigation, engineering, and simulations. Learning the distance formula therefore provides an important foundation for understanding more advanced concepts involving coordinates and geometric measurements.

















