Distance Between Two Points: Definition, Method and Examples

MathPublished

Distance Between Two Points: Formula, Methods, and Examples

The distance between two points on a coordinate plane is the exact length of the straight line segment joining them. To find this length, identify the horizontal and vertical changes between the points and apply the Pythagorean theorem.

What is distance between two points?

The distance between any two locations is a measure of the shortest path connecting them. On a flat surface, this path is always a straight line segment.


In coordinate geometry, every point is identified by an ordered pair (x,y)(x, y). The distance is the mathematical length of the segment connecting these two sets of coordinates. Because length measures a physical magnitude, distance must always be a positive value or zero.


The shortest distance between two points is the straight line connecting them.

A coordinate plane showing a straight line segment connecting point A at x1 comma y1 and point B at x2 comma y2.

Build a right triangle from coordinate changes

To calculate the length between two angled points, separate the path into horizontal and vertical movements. This creates a right-angled triangle where the original segment acts as the hypotenuse.


Find the horizontal change by subtracting the xx-coordinates. Find the vertical change by subtracting the yy-coordinates. The intersection of these two paths always forms a right angle.

A right triangle on a coordinate plane connecting points A and B, showing a horizontal base representing the change in x and a vertical height representing the change in y.

Derive and use the distance formula

Because the horizontal and vertical paths form a right triangle, the Pythagorean theorem applies. The theorem states that the square of the hypotenuse equals the sum of the squares of the other two sides.


Let the points be (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). The horizontal side has length x2−x1x_2 - x_1 and the vertical side has length y2−y1y_2 - y_1.


Substitute these expressions into the Pythagorean theorem:

d2=(x2−x1)2+(y2−y1)2d^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2


Take the square root of both sides to isolate the distance dd. This yields the final coordinate distance formula.


Coordinate distance formulad=(x2−x1)2+(y2−y1)2 d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}


Steps to use the formula:

  1. Assign (x1,y1)(x_1, y_1) to the first coordinate pair and (x2,y2)(x_2, y_2) to the second pair.
  2. Subtract the xx-coordinates and apply an exponent of two to the result.
  3. Subtract the yy-coordinates and apply an exponent of two to the result.
  4. Add the two squared values together.
  5. Take the principal square root of the sum.

Handle horizontal and vertical segments

When two points share the same xx-coordinate or the same yy-coordinate, the segment connecting them is perfectly horizontal or vertical. In these cases, using the full distance formula is unnecessary.


For a horizontal segment, the yy-coordinates are identical. The distance is the absolute difference between the changing xx-coordinates.


For a vertical segment, the xx-coordinates are identical. The distance is the absolute difference between the changing yy-coordinates.

A coordinate plane showing a horizontal segment of length 5 and a separate vertical segment of length 4.

Use exact values and sensible approximations

The result of the distance formula often involves a square root that does not simplify to a whole number.


An exact value leaves the distance in radical form, such as 13\sqrt{13} or 525\sqrt{2}. This format preserves perfect mathematical accuracy and is preferred in algebra and geometry proofs.


A decimal approximation evaluates the square root, typically rounded to one or two decimal places, such as 3.613.61. This format is useful for real-world applications where a measurable length is needed. Always check which format the context requires.

Worked examples

These examples demonstrate how to find the length between coordinates in different scenarios.


Example 1: Calculating standard distance


Question: What is the exact distance between the points P(−3,4)P(-3, 4) and Q(5,−2)Q(5, -2)?

Method:

  1. Assign (x1,y1)=(−3,4)(x_1, y_1) = (-3, 4) and (x2,y2)=(5,−2)(x_2, y_2) = (5, -2).
  2. Substitute into the distance formula: d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.
  3. d=(5−(−3))2+(−2−4)2d = \sqrt{(5 - (-3))^2 + (-2 - 4)^2}.
  4. d=(8)2+(−6)2d = \sqrt{(8)^2 + (-6)^2}.
  5. d=64+36d = \sqrt{64 + 36}.
  6. d=100d = \sqrt{100}.

Answer: The distance is 1010 units.


Check: A right triangle with legs of 88 and 66 forms a Pythagorean triple (6,8,10)(6, 8, 10), confirming the hypotenuse is indeed 1010.


Example 2: Checking side lengths of a geometric figure


Question: A triangle has vertices at A(1,1)A(1, 1), B(4,5)B(4, 5), and C(1,5)C(1, 5). Find the lengths of all three sides to determine if it is a right-angled triangle.


A right triangle plotted on a coordinate grid with vertices at 1 comma 1, 4 comma 5, and 1 comma 5.


Method:

  1. Find the vertical side ACAC. Since the xx-coordinates are both 11, subtract the yy-coordinates: ∣5−1∣=4|5 - 1| = 4.
  2. Find the horizontal side BCBC. Since the yy-coordinates are both 55, subtract the xx-coordinates: ∣4−1∣=3|4 - 1| = 3.
  3. Find the hypotenuse ABAB using the distance formula: d=(4−1)2+(5−1)2d = \sqrt{(4 - 1)^2 + (5 - 1)^2}.
  4. d=(3)2+(4)2=9+16=25=5d = \sqrt{(3)^2 + (4)^2} = \sqrt{9 + 16} = \sqrt{25} = 5.
  5. Check the Pythagorean theorem: 32+42=523^2 + 4^2 = 5^2, which simplifies to 9+16=259 + 16 = 25.

Answer: The side lengths are 33, 44, and 55. Because they satisfy the Pythagorean theorem, it is a right-angled triangle.


Check: Once side lengths are confirmed, this information can be used to classify the shape or calculate the area of a triangle from coordinates.


Example 3: Finding an unknown coordinate


Question: The distance between M(2,y)M(2, y) and N(8,−1)N(8, -1) is 1010 units. What are the possible values for yy?


Method:

  1. Set up the distance formula: 10=(8−2)2+(−1−y)210 = \sqrt{(8 - 2)^2 + (-1 - y)^2}.
  2. Square both sides to remove the radical: 100=(6)2+(−1−y)2100 = (6)^2 + (-1 - y)^2.
  3. Simplify the known square: 100=36+(−1−y)2100 = 36 + (-1 - y)^2.
  4. Subtract 3636 from both sides: 64=(−1−y)264 = (-1 - y)^2.
  5. Take the square root of both sides, remembering to include both positive and negative roots: ±8=−1−y\pm 8 = -1 - y.
  6. Solve for the first case: 8=−1−y8 = -1 - y yields y=−9y = -9.
  7. Solve for the second case: −8=−1−y-8 = -1 - y yields y=7y = 7.

Answer: The possible values are y=−9y = -9 or y=7y = 7.


Check: Substitute y=7y = 7 back into the formula: (8−2)2+(−1−7)2=36+(−8)2=100=10\sqrt{(8 - 2)^2 + (-1 - 7)^2} = \sqrt{36 + (-8)^2} = \sqrt{100} = 10. Both values satisfy the equation.

Common mistakes

Forgetting to square the differences

A frequent error is finding the difference between coordinates but forgetting to apply the exponent of two before adding them together. The formula strictly relies on the squares of the triangle's legs.


Adding instead of subtracting coordinates

The distance formula measures the difference between coordinates to find the length of a side. Adding x1x_1 and x2x_2 will locate a completely different position on the plane instead of measuring a length.


Writing a negative result

Distance represents a physical length. While coordinate differences can be negative, squaring them makes them positive. The final principal square root must always be a positive number or zero.

Frequently asked questions

Does the order of the points matter?

No, the order does not matter. Calculating x2−x1x_2 - x_1 gives the opposite sign of x1−x2x_1 - x_2, but squaring the result produces the identical positive number in both cases.


Can the distance formula be used in three dimensions?

Yes, the formula expands naturally into three dimensions. For points (x1,y1,z1)(x_1, y_1, z_1) and (x2,y2,z2)(x_2, y_2, z_2), the spatial length is calculated as (x2−x1)2+(y2−y1)2+(z2−z1)2\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}.


What other formulas use coordinates?

Once you know how to find the length between two points, you can explore the midpoint formula to locate the exact centre of a segment, or calculate the slope of a line to describe its steepness. These are core tools needed for exploring formal coordinate geometry proofs.

Practice questions

Question

A coordinate plane showing a right triangle connecting point 1 comma 1 and point 6 comma 13.


What is the exact distance between the two points shown on the coordinate plane?

  • 1717

  • 77

  • 1313

  • 169169

Answer:

1313

Question

A horizontal line segment on a coordinate plane connecting a point at negative 4 comma 3 and another point at 3 comma 3.


What is the length of the line segment?

  • 11

  • 77

  • 1111

  • 1414

Answer:

77

Question

What is the exact distance between the points A(−1,−4)A(-1, -4) and B(−5,−6)B(-5, -6)?

  • 252\sqrt{5}

  • 10\sqrt{10}

  • 2020

  • 1010

Answer:

252\sqrt{5}

Question

A coordinate plane showing a point at 2 comma 1 and another point at 6 comma 4.

A student calculated the distance between (2,1)(2, 1) and (6,4)(6, 4) as 77 units. What error did the student most likely make?

  • They added the horizontal and vertical differences instead of using the Pythagorean theorem.

  • They forgot to take the square root at the end of the calculation.

  • They subtracted the yy-coordinates from the xx-coordinates.

  • They added the given coordinates together instead of finding the differences.

Answer:

They added the horizontal and vertical differences instead of using the Pythagorean theorem.

Question

Which of the following is a possible xx-coordinate if the distance between (x,2)(x, 2) and (6,−1)(6, -1) is 55 units?

  • 22

  • 33

  • 55

  • 1111

Answer:

22