TExcelTAD
Home › School Analytical Trigonometry & Conic Sections › Distance and Midpoint Formulas in the Cartesian Plane

Distance and Midpoint Formulas in the Cartesian Plane

In elementary geometry, we measure lengths with a physical ruler and locate midpoints by folding paper or using a compass. In analytical geometry, René Descartes united algebra and geometry by identifying every geometric point with an ordered pair of numbers (x,y)(x, y) in the Cartesian coordinate plane.

With coordinates assigned to points, measuring distances and finding midpoints becomes an exact, paper-and-pencil algebraic calculation. The Distance Formula is simply the Pythagorean theorem translated into coordinates, while the Midpoint Formula calculates the arithmetic mean of the coordinates.


Geometric Derivations on Paper

1. The Distance Formula from the Pythagorean Theorem

Suppose we have two arbitrary points in the plane:

A(xA,yA)andB(xB,yB)A(x_A, y_A) \quad \text{and} \quad B(x_B, y_B)

To find the straight-line distance d(A,B)d(A, B) between them, construct a right triangle △ACB\triangle ACB by drawing a horizontal line through AA and a vertical line through BB. These lines intersect at the right-angled vertex C(xB,yA)C(x_B, y_A):

M(x0, y0) H (Foot) Line d: Ax + By + C = 0 Distance d(M, d) = |Ax0 + By0 + C| / sqrt(A^2 + B^2)
  1. Length of the Horizontal Leg ACAC: Because both AA and CC share the same yy-coordinate (yAy_A), the horizontal distance is:
    AC=∣xB−xA∣AC = |x_B - x_A|
  2. Length of the Vertical Leg CBCB: Because both CC and BB share the same xx-coordinate (xBx_B), the vertical distance is:
    CB=∣yB−yA∣CB = |y_B - y_A|
  3. Hypotenuse ABAB via the Pythagorean Theorem: In right triangle △ACB\triangle ACB:
    AB2=AC2+CB2=(xB−xA)2+(yB−yA)2AB^2 = AC^2 + CB^2 = (x_B - x_A)^2 + (y_B - y_A)^2
    Taking the principal (non-negative) square root yields the Distance Formula:
d(A,B)=(xB−xA)2+(yB−yA)2d(A, B) = \sqrt{(x_B - x_A)^2 + (y_B - y_A)^2}

[!NOTE] Because (xB−xA)2=(xA−xB)2(x_B - x_A)^2 = (x_A - x_B)^2, the order in which you label the points does not matter: d(A,B)=d(B,A)d(A, B) = d(B, A). Notice also that this is precisely the magnitude of the displacement vector: d(A,B)=∣AB⃗∣d(A, B) = |\vec{AB}|.


2. The Midpoint Formula via Arithmetic Averaging

The midpoint M(xM,yM)M(x_M, y_M) of segment ABAB is the point that lies directly on the segment halfway between AA and BB, such that:

AM=MB=12ABAM = MB = \frac{1}{2}AB

Using vectors, the displacement from AA to MM is exactly half the total displacement from AA to BB:

AM⃗=12AB⃗\vec{AM} = \frac{1}{2}\vec{AB}

Writing this in components:

(xM−xA,  yM−yA)=12(xB−xA,  yB−yA)(x_M - x_A, \; y_M - y_A) = \frac{1}{2}(x_B - x_A, \; y_B - y_A)

Equating the xx-components on paper:

xM−xA=12(xB−xA)xM=xA+12xB−12xAxM=12xA+12xB=xA+xB2\begin{aligned} x_M - x_A &= \frac{1}{2}(x_B - x_A) \\ x_M &= x_A + \frac{1}{2}x_B - \frac{1}{2}x_A \\ x_M &= \frac{1}{2}x_A + \frac{1}{2}x_B = \frac{x_A + x_B}{2} \end{aligned}

Equating the yy-components in the exact same manner gives:

yM=yA+yB2y_M = \frac{y_A + y_B}{2}

Therefore, the coordinates of the midpoint are simply the arithmetic averages (mean values) of the coordinates of the two endpoints:

M=(xA+xB2,  yA+yB2)M = \left( \frac{x_A + x_B}{2}, \; \frac{y_A + y_B}{2} \right)

Reconstructing an Unknown Endpoint

A very frequent notebook and examination problem provides one endpoint A(xA,yA)A(x_A, y_A) and the midpoint M(xM,yM)M(x_M, y_M), asking you to find the coordinates of the other endpoint B(xB,yB)B(x_B, y_B).

By rearranging the midpoint equations:

xM=xA+xB2  ⟹  2xM=xA+xB  ⟹  xB=2xM−xAx_M = \frac{x_A + x_B}{2} \implies 2x_M = x_A + x_B \implies x_B = 2x_M - x_A
yM=yA+yB2  ⟹  2yM=yA+yB  ⟹  yB=2yM−yAy_M = \frac{y_A + y_B}{2} \implies 2y_M = y_A + y_B \implies y_B = 2y_M - y_A
B(xB,yB)=(2xM−xA,  2yM−yA)B(x_B, y_B) = (2x_M - x_A, \; 2y_M - y_A)

Master Formula Box

ConceptPaper FormulaDistance between A(x1,y1) and B(x2,y2)d(A,B)=(x2−x1)2+(y2−y1)2Midpoint of segment ABM=(x1+x22,  y1+y22)Reconstructed Endpoint BB=(2xM−xA,  2yM−yA)Collinearity Criterion via DistanceA,B,C collinear  ⟺  d(A,B)+d(B,C)=d(A,C)\begin{array}{|c|c|} \hline \textbf{Concept} & \textbf{Paper Formula} \\ \hline \text{Distance between } A(x_1, y_1) \text{ and } B(x_2, y_2) & d(A, B) = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \\ \hline \text{Midpoint of segment } AB & M = \left(\dfrac{x_1 + x_2}{2}, \; \dfrac{y_1 + y_2}{2}\right) \\ \hline \text{Reconstructed Endpoint } B & B = (2x_M - x_A, \; 2y_M - y_A) \\ \hline \text{Collinearity Criterion via Distance} & A, B, C \text{ collinear} \iff d(A, B) + d(B, C) = d(A, C) \\ \hline \end{array}

Step-by-Step Paper Calculation Method

  1. Label Coordinates Explicitly: Write down x1,y1x_1, y_1 and x2,y2x_2, y_2 above the numbers.
  2. Compute Coordinate Differences:
    • Δx=x2−x1\Delta x = x_2 - x_1
    • Δy=y2−y1\Delta y = y_2 - y_1
    • Be meticulous with signs: e.g., 3−(−5)=3+5=83 - (-5) = 3 + 5 = 8.
  3. Square and Sum:
    • (Δx)2≥0(\Delta x)^2 \ge 0 and (Δy)2≥0(\Delta y)^2 \ge 0.
    • Sum the squares: S=(Δx)2+(Δy)2S = (\Delta x)^2 + (\Delta y)^2.
  4. Extract and Simplify Radicals:
    • If SS is a perfect square (25,100,16925, 100, 169), evaluate the integer.
    • If SS contains square factors (50=25×250 = 25 \times 2), simplify to 525\sqrt{2}.
  5. Compute Midpoint Coordinates:
    • Add the xx-values and divide by 22.
    • Add the yy-values and divide by 22.
    • Keep fractions in simplified form (e.g., 72\frac{7}{2} or 3.53.5).

Step-by-Step Notebook Examples

Example 1: Basic Distance and Midpoint Calculation

Problem Statement: In the Cartesian plane, points A(−3,5)A(-3, 5) and B(5,−1)B(5, -1) are given.

  1. Find the exact distance d(A,B)d(A, B).
  2. Find the coordinates of the midpoint MM of segment ABAB.

Paper Calculation Steps:

  1. Calculate the Coordinate Differences:

    Δx=xB−xA=5−(−3)=5+3=8\Delta x = x_B - x_A = 5 - (-3) = 5 + 3 = 8
    Δy=yB−yA=−1−5=−6\Delta y = y_B - y_A = -1 - 5 = -6
  2. Compute Distance:

    d(A,B)=(Δx)2+(Δy)2=82+(−6)2=64+36=100=10\begin{aligned} d(A, B) &= \sqrt{(\Delta x)^2 + (\Delta y)^2} \\ &= \sqrt{8^2 + (-6)^2} \\ &= \sqrt{64 + 36} \\ &= \sqrt{100} \\ &= 10 \end{aligned}
  3. Compute Midpoint Coordinates:

    xM=xA+xB2=−3+52=22=1yM=yA+yB2=5+(−1)2=42=2\begin{aligned} x_M &= \frac{x_A + x_B}{2} = \frac{-3 + 5}{2} = \frac{2}{2} = 1 \\ y_M &= \frac{y_A + y_B}{2} = \frac{5 + (-1)}{2} = \frac{4}{2} = 2 \end{aligned}
  4. Verify Paper Consistency: Check distance from A(−3,5)A(-3, 5) to M(1,2)M(1, 2):

    d(A,M)=(1−(−3))2+(2−5)2=42+(−3)2=16+9=25=5d(A, M) = \sqrt{(1 - (-3))^2 + (2 - 5)^2} = \sqrt{4^2 + (-3)^2} = \sqrt{16 + 9} = \sqrt{25} = 5

    Since d(A,M)=5=12d(A,B)d(A, M) = 5 = \frac{1}{2} d(A, B), the midpoint is algebraically verified!

Final Answer:

  • d(A,B)=10d(A, B) = 10
  • M(1,2)M(1, 2)

Example 2: Proving Collinearity via the Triangle Inequality

Problem Statement: Three points are given: P(1,2)P(1, 2), Q(4,6)Q(4, 6), and R(10,14)R(10, 14).

  1. Compute the lengths of segments PQPQ, QRQR, and PRPR.
  2. Prove that the three points lie on a single straight line (collinear).

Paper Calculation Steps:

  1. Calculate Distance PQPQ:

    d(P,Q)=(4−1)2+(6−2)2=32+42=9+16=25=5\begin{aligned} d(P, Q) &= \sqrt{(4 - 1)^2 + (6 - 2)^2} \\ &= \sqrt{3^2 + 4^2} \\ &= \sqrt{9 + 16} = \sqrt{25} = 5 \end{aligned}
  2. Calculate Distance QRQR:

    d(Q,R)=(10−4)2+(14−6)2=62+82=36+64=100=10\begin{aligned} d(Q, R) &= \sqrt{(10 - 4)^2 + (14 - 6)^2} \\ &= \sqrt{6^2 + 8^2} \\ &= \sqrt{36 + 64} = \sqrt{100} = 10 \end{aligned}
  3. Calculate Distance PRPR:

    d(P,R)=(10−1)2+(14−2)2=92+122=81+144=225=15\begin{aligned} d(P, R) &= \sqrt{(10 - 1)^2 + (14 - 2)^2} \\ &= \sqrt{9^2 + 12^2} \\ &= \sqrt{81 + 144} = \sqrt{225} = 15 \end{aligned}
  4. Compare Distances:

    d(P,Q)+d(Q,R)=5+10=15=d(P,R)d(P, Q) + d(Q, R) = 5 + 10 = 15 = d(P, R)

    By the triangle inequality, three points P,Q,RP, Q, R satisfy d(P,Q)+d(Q,R)=d(P,R)d(P, Q) + d(Q, R) = d(P, R) if and only if QQ lies strictly on the segment connecting PP and RR. Therefore, the points are collinear.

Final Answer:

  • d(P,Q)=5d(P, Q) = 5, d(Q,R)=10d(Q, R) = 10, d(P,R)=15d(P, R) = 15.
  • Because 5+10=155 + 10 = 15, points P,Q,RP, Q, R are collinear.

Example 3: Finding a Missing Endpoint

Problem Statement: Segment CDCD has midpoint M(3,−4)M(3, -4). If point CC has coordinates (−1,2)(-1, 2), find the coordinates of point DD.

Paper Calculation Steps:

  1. Identify Given Quantities:

    • xC=−1x_C = -1, yC=2y_C = 2
    • xM=3x_M = 3, yM=−4y_M = -4
    • Target: D(xD,yD)D(x_D, y_D)
  2. Set Up the Midpoint Equations:

    xC+xD2=xM  ⟹  −1+xD2=3\frac{x_C + x_D}{2} = x_M \implies \frac{-1 + x_D}{2} = 3
    yC+yD2=yM  ⟹  2+yD2=−4\frac{y_C + y_D}{2} = y_M \implies \frac{2 + y_D}{2} = -4
  3. Solve for xDx_D and yDy_D:

    • Multiply by 22:
      −1+xD=6  ⟹  xD=6+1=7-1 + x_D = 6 \implies x_D = 6 + 1 = 7
    • Multiply by 22:
      2+yD=−8  ⟹  yD=−8−2=−102 + y_D = -8 \implies y_D = -8 - 2 = -10
  4. Check by Direct Substitution: Average of C(−1,2)C(-1, 2) and D(7,−10)D(7, -10):

    (−1+72,  2+(−10)2)=(62,  −82)=(3,−4)\left( \frac{-1 + 7}{2}, \; \frac{2 + (-10)}{2} \right) = \left( \frac{6}{2}, \; \frac{-8}{2} \right) = (3, -4)

    This matches point M(3,−4)M(3, -4) exactly!

Final Answer: Point DD has coordinates (7,−10)(7, -10).


Common Mistakes & Paper Traps

[!WARNING] Trap 1: Subtracting Instead of Adding in the Midpoint Formula. A very common student slip is writing:

M=(x2−x12,y2−y12)(WRONG!)M = \left(\frac{x_2 - x_1}{2}, \frac{y_2 - y_1}{2}\right) \quad \text{(WRONG!)}

Midpoints are arithmetic averages: you must ADD the coordinates, x1+x22\frac{x_1 + x_2}{2}. The minus sign belongs exclusively to the distance formula and vector components.

[!WARNING] Trap 2: Illegally Distributing Square Roots over Sums. Writing Δx2+Δy2=Δx+Δy\sqrt{\Delta x^2 + \Delta y^2} = \Delta x + \Delta y is mathematically false! For example:

32+42=9+16=25=5≠3+4=7\sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5 \neq 3 + 4 = 7

Always add the squared values first before extracting the square root.

[!WARNING] Trap 3: Sign Errors When Subtracting Negative Coordinates. When computing Δx=x2−x1\Delta x = x_2 - x_1 with x1=−4x_1 = -4, write explicitly:

x2−(−4)=x2+4x_2 - (-4) = x_2 + 4

Dropping the double negative leads to incorrect leg lengths and wrong distances.


Pencil & Paper Practice

Work these exercises on paper before reviewing the complete solutions below.

Practice Problems

  1. Problem 1: Find the distance between A(2,−3)A(2, -3) and B(−2,1)B(-2, 1) in simplest radical form.
  2. Problem 2: Segment EFEF has endpoints E(−7,3)E(-7, 3) and F(5,−9)F(5, -9). Find the coordinates of its midpoint.
  3. Problem 3: The center of a circle is O(1,2)O(1, 2). One end of a diameter is A(−3,−2)A(-3, -2). Find the coordinates of the other end BB of the diameter, and calculate the radius of the circle.

Step-by-Step Solutions

Solution 1:

  • Δx=−2−2=−4\Delta x = -2 - 2 = -4.
  • Δy=1−(−3)=4\Delta y = 1 - (-3) = 4.
  • d(A,B)=(−4)2+42=16+16=32=16×2=42d(A, B) = \sqrt{(-4)^2 + 4^2} = \sqrt{16 + 16} = \sqrt{32} = \sqrt{16 \times 2} = 4\sqrt{2}.

Solution 2:

  • xM=−7+52=−22=−1x_M = \frac{-7 + 5}{2} = \frac{-2}{2} = -1.
  • yM=3+(−9)2=−62=−3y_M = \frac{3 + (-9)}{2} = \frac{-6}{2} = -3.
  • Midpoint: M(−1,−3)M(-1, -3).

Solution 3:

  • Because ABAB is a diameter, the circle center O(1,2)O(1, 2) is the midpoint of ABAB.
  • Using the missing endpoint formula for B(xB,yB)B(x_B, y_B):
    xB=2xO−xA=2(1)−(−3)=2+3=5x_B = 2x_O - x_A = 2(1) - (-3) = 2 + 3 = 5
    yB=2yO−yA=2(2)−(−2)=4+2=6y_B = 2y_O - y_A = 2(2) - (-2) = 4 + 2 = 6
    So B(5,6)B(5, 6).
  • Radius R=d(O,A)R = d(O, A):
    R=(1−(−3))2+(2−(−2))2=42+42=16+16=32=42R = \sqrt{(1 - (-3))^2 + (2 - (-2))^2} = \sqrt{4^2 + 4^2} = \sqrt{16 + 16} = \sqrt{32} = 4\sqrt{2}

Summary

  • The distance formula gives the straight-line segment length:
    d(A,B)=(x2−x1)2+(y2−y1)2d(A, B) = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
  • The midpoint formula computes the arithmetic coordinate average:
    M=(x1+x22,  y1+y22)M = \left(\frac{x_1 + x_2}{2}, \; \frac{y_1 + y_2}{2}\right)
  • To recover a missing endpoint from midpoint MM and endpoint AA:
    B=(2xM−xA,  2yM−yA)B = (2x_M - x_A, \; 2y_M - y_A)

Test yourself

What is the distance between the points P(−1,4)P(-1, 4) and Q(5,−4)Q(5, -4)?

  1. 10
  2. 20\sqrt{20}
  3. 14
  4. 28\sqrt{28}

What are the coordinates of the midpoint of segment connecting (−6,11)(-6, 11) and (2,−5)(2, -5)?

  1. (−2,3)(-2, 3)
  2. (−4,6)(-4, 6)
  3. (4,−8)(4, -8)
  4. (−2,8)(-2, 8)

If M(4,−1)M(4, -1) is the midpoint of segment ABAB and A(1,3)A(1, 3), what are the coordinates of endpoint BB?

  1. (7,−5)(7, -5)
  2. (2.5,1)(2.5, 1)
  3. (9,−5)(9, -5)
  4. (7,1)(7, 1)