Distance and Midpoint Formulas

The distance between two points and midpoint of a segment formulas are presented along with examples, questions , including detailed solutions .
A distance and midpoint calculator is included to check your answers.

Distance Formula

Let us first define the distance \( d \) between two points \( A \) and \( B \) whose coordinates are respectively \( a \) and \( b \) on a number line as \[ d = |a - b| = |b - a| \]

 Distance Between Points on the Number Line
Fig.1 - Distance Between Points on the Number Line
Note that because of the absolute value, the distance between points is always positive or equal to zero.

We now review the Pythagorean theorem: given a right triangle, as shown in figure 2 below, the hypotenuse (side opposite the right angle) and the two sides are related by: \[ h^2 = x^2 + y^2 \quad \text{or} \quad h = \sqrt {x^2 + y^2}\]
 The Pythagorean Theorem
Fig.2 - The Pythagorean Theorem

We now use the distance between points on a number line and the Pythagorean theorem to the right triangle in figure 3 to write the formula for the distance between any two points on a plane.
Given two points \( A = (a_x,a_y) \) and \( B = (b_x,b_y) \), the formula that gives the distance \( d \) between the two points \( A \) and \( B \), or the length of the line segment \(AB\), is given by \[ \large \color{red}{d = \sqrt { (b_x - a_x)^2 + (b_y - a_y)^2} \qquad (I) } \]
Distance Between two Points on a Plane
Fig.3 - Distance Between two Points on a Plane

Note that   \( |b_x - a_x|^2 = (b_x - a_x)^2 \)   and   \( | b_y - a_y |^2 = (b_y - a_y)^2 \)

Example
Find the distance \( d \) between the points \( A = (3,2) \) and \( B = (-3,-6) \)
Solution
According to the formula (I), the distance \( d \) is given by
\( d = \sqrt{ (-3 - 3)^2 + (-6 - 2)^2 } = \sqrt{(-6)^2 + (-8)^2} = \sqrt{36+64} = \sqrt {100} = 10 \)



Midpoint Definition and Formula

The midpoint \( M \) of the line segment \( A B \) is the point on the line segment \( A B \) such that the lengths of the segments \( MA \) and \( MB \) are equal. (See figure 4 below).
Given two points \( A = (a_x,a_y) \) and \( B = (b_x,b_y) \), the formula that give the coordinates of the midpoint \( M \) of the segment \(AB \) is given by \[ \large \color{red}{ M = \left(\dfrac{a_x+b_x}{2} \; , \; \dfrac{a_y+b_y}{2} \right) } \qquad (II) \]
Note that the \( x \) and \( y \) coordinates of \( M \) are given by the average of the \( x \) and \( y \) coordinates of the points \( A \) and \(B \) respectively.

Midpoint Formula
Fig.4 - Midpoint
Example
Find the midpoint of the line segment \( AB \) given that \( A = (5,2) \) and \( B = (-7,-10) \)
Solution
According to the formula (II), the coordinates of the midpoint \( M \) are given by
\( M = \left( \dfrac{5+(-7)}{2} , \dfrac{2+(-10)}{2} \right) = \left( \dfrac{-2}{2} , \dfrac{-8}{2} \right) = ( -1 , -4 )\)



Questions

Part A

Find the distance between each pair of points in the number lines shown below.
Pairs of Points on the Number Line


Part B

Find the distance between the given pair of points.

  1. \( A = (0,0) \; , \; B = (-4,3) \)
  2. \( C = (-2,-2) \; , \; D = (6,4) \)
  3. \( E = (4,7) \; , \; F = (-4,7) \)


Part C

Find the midpoint between the segments defined by pair of points.

  1. \( A = (-8,0) \; , \; B = (-4,4) \)
  2. \( C = (-3,-4) \; , \; D = (8,3) \)
  3. \( E = (4,7) \; , \; F = (-4,7) \)


Part D

Given the points \( A = (x_0,y_0) \) and \( B = (-4,8) \). Find the coordinates of point \( A \) if the midpoint of the segment \( AB \) is the point \( M = (-2,0) \).


Part E

Given the points \( A = (3 x_0, -y_0) \) and \( B = ( x_0, 4 y_0) \). Find the coordinates of \( A \) and \( B \) if the midpoint of the segment \( AB \) is the point \( M = (2,6) \).


Part F

  1. Find the midpoint \( M \) of the segment defined by the points \( A = (-4,1) \) and \( B = (2,5) \)
  2. Find the lengths of the segments \( MA \) and \( MB \). Are they equal?
  3. Find the length of the line segment \( AB \)
  4. Show that the length of the line segment \( MA \) is half the length of the line segment \( AB \).



Solutions to the Above Questions

Part A

The formula for the distance between two points on a number line is given above.

  1. The coordinate of point \( A \) is equal to \( -2 \) and the coordinate of point \( B \) is equal to \( 9 \); hence the distance \( d_1 \) between \( A \) and \( B \) is given by
    \( d_1 = | - 2 - 9 | = |-11| = 11 \)        or        \( d_1 = | 9 - (-2) | = |11| = 11 \)
  2. The coordinate of point \( C \) is equal to \( - 8 \) and the coordinate of point \( D \) is equal to \( - 3 \); hence the distance \( d_2 \) between \( C \) and \( D \) is given by
    \( d_2 = | -8 - (-3) | = |-8 + 3| = |-5| = 5\)        or        \( d_2 = | -3 - (-8) | = |-3 + 8| = |5| = 5 \)
  3. The coordinate of point \( E \) is equal to \( 3 \) and the coordinate of point \( F \) is equal to \( 10 \); hence the distance \( d_3 \) between \( E \) and \( F \) is given by
    \( d_3 = | 3 - 10 | = |-7| = 7 \)        or        \( d = | 10 - 3 | = |7| = 7 \)


Part B

The formula for the distance between two points on a plane is given above.

  1. \( d(AB) = \sqrt { (-4 - 0)^2 + (3-0)^2} = \sqrt { (-4)^2 + (3)^2} = \sqrt { 16 + 9} = \sqrt{25} = 5 \)
  2. \( d(CD) = \sqrt { (6 - (-2))^2 + (4-(-2))^2} = \sqrt { (6+2)^2 + (4+2)^2} = \sqrt { 8^2 + 6^2 } = \sqrt{100} = 10\)
  3. \( d (EF) = \sqrt { (-4 - 4)^2 + (7-7)^2} = \sqrt { (-8)^2 + 0 } = \sqrt { (-8)^2 } = \sqrt { 64 } = 8 \)


Part C

The formula for the midpoint is given above.

  1. \( M_{AB} = \left(\dfrac{-8+(-4)}{2} , \dfrac{0+4}{2}\right) = \left(\dfrac{-12}{2} , \dfrac{4}{2}\right) = (-6 , 2) \)
  2. \( M_{CD} = \left(\dfrac{-3+8}{2} , \dfrac{-4+3}{2}\right) = (5/2 , -1/2) \)
  3. \( M_{EF} = \left(\dfrac{4+(-4)}{2} , \dfrac{7+7}{2}\right) = (0 , 7) \)


Part D

Given the points \( A = (x_0,y_0) \) and \( B = (-4,8) \), the use of the formula of the midpoint \( M \) of \( A B \) gives: \( \quad M = \left( \dfrac{x_0 + (-4)}{2} , \dfrac{y_0 + 8}{2} \right) \)
The coordinates of the midpoint are given as \( (-2,0) \)
We write that the coordinates of the midpoint are equal and therefore obtain the equations: \( \dfrac{x_0 + (-4)}{2} = - 2 \)     (I)      and    \( \dfrac{y_0 + 8}{2} = 0 \)     (II)
Multiply both sides of equation (I) above by \( 2 \): \( \quad 2 \times \dfrac{x_0 + (-4)}{2} = 2 \times (- 2) \)
Simplify: \( \quad x_0 - 4 = -4 \)
Solve for \( x_0 \) to obtain \( x_0 = 0 \)
Multiply both sides of equation (II) above by \( 2 \):\( \quad 2 \times \dfrac{y_0 + 8}{2} = 2 \times (0) \)
Simplify: \( \quad y_0 + 8 = 0 \)
Solve for \( y_0 \) to obtain \( y_0 = -8 \)
Since of \( A = (x_0,y_0) \), the coordinates of \( A \) are given by: \( \quad A = (0,-8) \)


Part E

Given the points \( A = (3 x_0, -y_0) \) and \( B = ( x_0, 4 y_0) \), the midpoint formula gives: \( \quad M = \left( \dfrac{3 x_0 + x_0}{2} , \dfrac{-y_0 + 4 y_0}{2} \right) \)
Group like terms in the above to obtain: \( \quad M = \left( \dfrac{4 x_0}{2} , \dfrac{3 y_0}{2} \right) \)
The coordinates of the midpoint \( M \) are known as \( (2,6) \)
Hence the equality of the coordinates gives the equations: \( \dfrac{4 x_0}{2} = 2 \)     (I)      and      \( \dfrac{3 y_0}{2} = 6 \)    (II)
Multiply both sides of equation (I) above by \( 2 \): \( \quad 2 \times \dfrac{4 x_0}{2} = 2 \times 2 \)
Simplify: \( \quad 4 x_0 = 4 \)
Solve for \( x_0 \) to obtain \( x_0 = 1 \)
Multiply both sides of equation (II) above by \( 2 \):\( \quad 2 \times \dfrac{3 y_0}{2} = 2 \times 6 \)
Simplify: \( \quad 3 y_0 = 12 \)
Solve for \( y_0 \) to obtain \( y_0 = 4 \)
Since of \( A = (3x_0,-y_0) \), the coordinates of \( A \) are given by: \( \quad A = (3,-4) \)
The coordinates of \( B = ( x_0, 4 y_0) \) are given by: \( \quad B = (1,16) \)


Part F

  1. Use the midpoint formula: \( \quad M = \left(\dfrac{-4+2}{2} , \dfrac{1+5}{2} \right) = ( -1 , 3) \)

    The length of a line segment whose endpoints are \( A \) and \( B \) is equal to the distance between \( A \) and \( B \) whose formula is given above.
  2. The length of segment \( MA \) is given by the distance formula: \( \quad d( MA ) = \sqrt { (-4 - (-1) )^2 + (1 - 3 )^2 } = \sqrt { (-3)^2 + (-2 )^2 } = \sqrt {9+4} = \sqrt {13} \)
    The length of segment \( MB \) is given by: \( \quad d( MB ) = \sqrt { (2 - (-1) )^2 + (5 - 3 )^2 } = \sqrt { (3)^2 + (2 )^2 } = \sqrt {9+4} = \sqrt {13} \)
    The lengths \( d(MA) \) and \( d(MB) \) of the segments \( MA \) and \( MB \) respectively are equal as expected because of the definition of the midpoint given above.

  3. The length \( d(AB) \) is given by: \( \quad d(AB) = \sqrt{ (2-(-4))^2 + (5-1)^2} = \sqrt{ 6^2 + 4^2} = \sqrt {52} = \sqrt {4 \times 13} = 2 \sqrt {13} \)

  4. \( \dfrac{1}{2} \times d(AB) = \dfrac{1}{2} \times 2 \sqrt {13} = \sqrt {13} = d(MA) \).
    Again the above is expected from the definition of the midpoint given above.



More References and Links to Triangles

plotting points in rectangular coordinate system
Pythagorean Theorem and Problems with Solutions
Geometry Tutorials and Problems
The Four Pillars of Geometry - John Stillwell - Springer; 2005th edition (Aug. 9 2005) - ISBN-10 : 0387255303
Geometry: A Comprehensive Course - Daniel Pedoe - Dover Publications - 2013 - ISBN: 9780486131733
Geometry: with Geometry Explorer - Michael Hvidsten - McGraw Hill - 2006 - ISBN: 0-07-294863-9