TExcelTAD
Home › Coordinate Geometry: 2D & 3D Cartesian Systems › Distance Formula, Midpoint, and Division of a Segment (Section Formula) in R²

Distance Formula, Midpoint, and Division of a Segment (Section Formula) in R2\mathbb{R}^2

Every geometric construction on paper—measuring lengths, finding geometric centers, and partitioning lines into proportions—can be solved algebraically when points are placed on a Cartesian coordinate plane.

In this lesson, we derive three fundamental tools of coordinate geometry: the Distance Formula, the Midpoint Formula, and the Section Formula (for both internal and external division).


1. The Distance Formula in R2\mathbb{R}^2

Suppose two distinct points A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2) are plotted on a Cartesian grid. Connecting them gives a line segment ABAB of length dd.

x y A(x_1, y_1) B(x_2, y_2) C(x_2, y_1) Deltax = |x_2 − x_1| Deltay = |y_2 − y_1| d

Derivation via the Pythagorean Theorem

Construct a right triangle △ABC\triangle ABC by drawing:

  1. A horizontal line segment through AA to the coordinate x2x_2.
  2. A vertical line segment through BB down to the coordinate y1y_1.

The legs of the right triangle have lengths:

Leg1=AC=∣x2−x1∣,Leg2=BC=∣y2−y1∣\text{Leg}_1 = AC = |x_2 - x_1|, \qquad \text{Leg}_2 = BC = |y_2 - y_1|

By the Pythagorean Theorem (c2=a2+b2c^2 = a^2 + b^2):

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

Taking the principal square root gives the Distance Formula:

d(A,B)=(x2−x1)2+(y2−y1)2d(A, B) = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

2. The Midpoint Formula

The midpoint MM of segment ABAB is the point equidistant from AA and BB that lies directly on the segment. Its coordinates are the arithmetic averages of the corresponding endpoints' coordinates:

M=(x1+x22,  y1+y22)M = \left( \frac{x_1 + x_2}{2}, \; \frac{y_1 + y_2}{2} \right)

Geometrically, the horizontal coordinate of MM is halfway between x1x_1 and x2x_2, and the vertical coordinate is halfway between y1y_1 and y2y_2.


3. Division of a Line Segment: The Section Formula

What if a point PP divides the line segment ABAB in a specific positive ratio m:nm : n rather than equally (1:11 : 1)?

A(x_1, y_1) P(x, y) B(x_2, y_2) m parts n parts

Internal Division

When P(x,y)P(x, y) lies strictly inside the segment between AA and BB such that:

APPB=mn\frac{AP}{PB} = \frac{m}{n}

By Thales's Theorem / similar right triangles:

x−x1x2−x=mn  ⟹  n(x−x1)=m(x2−x)  ⟹  nx−nx1=mx2−mx\frac{x - x_1}{x_2 - x} = \frac{m}{n} \implies n(x - x_1) = m(x_2 - x) \implies nx - nx_1 = mx_2 - mx

Gathering terms in xx:

(m+n)x=mx2+nx1  ⟹  x=mx2+nx1m+n(m + n)x = mx_2 + nx_1 \implies x = \frac{mx_2 + nx_1}{m + n}

Applying the identical argument along the vertical axis gives:

P(x,y)=(mx2+nx1m+n,  my2+ny1m+n)P(x, y) = \left( \frac{m x_2 + n x_1}{m + n}, \; \frac{m y_2 + n y_1}{m + n} \right)

Memory Rule (Criss-Cross): The ratio term mm (associated with AA) multiplies the coordinates of the opposite point BB, while nn (associated with BB) multiplies the coordinates of AA.

External Division

When P′(x′,y′)P'(x', y') lies on the extended line outside the segment ABAB such that:

AP′BP′=mn(m≠n)\frac{AP'}{BP'} = \frac{m}{n} \quad (m \neq n)

The derivation follows identically with a sign reversal on nn:

P′(x′,y′)=(mx2−nx1m−n,  my2−ny1m−n)P'(x', y') = \left( \frac{m x_2 - n x_1}{m - n}, \; \frac{m y_2 - n y_1}{m - n} \right)

4. Step-by-Step Paper Notebook Method

Step 1:Label points explicitly: (x1,y1) and (x2,y2).Step 2:For Distance: compute differences Δx=x2−x1 and Δy=y2−y1.Square both (always positive), sum them, and simplify the radical Δx2+Δy2.Step 3:For Midpoint: calculate the arithmetic means x1+x22 and y1+y22.Step 4:For Section Formula: write the ratio m:n. Cross-multiply m(x2)+n(x1) over m+n.\begin{aligned} \text{\bf Step 1:} &\quad \text{Label points explicitly: } (x_1, y_1) \text{ and } (x_2, y_2). \\ \text{\bf Step 2:} &\quad \text{For Distance: compute differences } \Delta x = x_2 - x_1 \text{ and } \Delta y = y_2 - y_1. \\ &\quad \text{Square both (always positive), sum them, and simplify the radical } \sqrt{\Delta x^2 + \Delta y^2}. \\ \text{\bf Step 3:} &\quad \text{For Midpoint: calculate the arithmetic means } \frac{x_1 + x_2}{2} \text{ and } \frac{y_1 + y_2}{2}. \\ \text{\bf Step 4:} &\quad \text{For Section Formula: write the ratio } m:n. \text{ Cross-multiply } m(x_2) + n(x_1) \text{ over } m+n. \end{aligned}

5. Comprehensive Worked Examples

Example 1: Distance and Simplified Radical Form

Problem Statement: Find the exact distance between A(−3,5)A(-3, 5) and B(5,−1)B(5, -1). Express the answer both as a simplified radical and rounded to two decimal places.

Step-by-Step Solution:

  • Step 1: Identify coordinates

    x1=−3,y1=5,x2=5,y2=−1x_1 = -3, \quad y_1 = 5, \quad x_2 = 5, \quad y_2 = -1
  • Step 2: Calculate coordinate differences

    Δx=x2−x1=5−(−3)=5+3=8Δy=y2−y1=−1−5=−6\begin{aligned} \Delta x &= x_2 - x_1 = 5 - (-3) = 5 + 3 = 8 \\ \Delta y &= y_2 - y_1 = -1 - 5 = -6 \end{aligned}
  • Step 3: Apply the Distance Formula

    d=(Δx)2+(Δy)2=(8)2+(−6)2=64+36=100=10 units\begin{aligned} d &= \sqrt{(\Delta x)^2 + (\Delta y)^2} \\ &= \sqrt{(8)^2 + (-6)^2} \\ &= \sqrt{64 + 36} \\ &= \sqrt{100} = 10\text{ units} \end{aligned}

The segment ABAB has an exact length of 10 units10\text{ units}.


Example 2: Finding an Unknown Endpoint from the Midpoint

Problem Statement: Point M(2,−3)M(2, -3) is the midpoint of segment PQPQ. If PP has coordinates (−4,1)(-4, 1), find the coordinates of endpoint Q(xQ,yQ)Q(x_Q, y_Q).

Step-by-Step Solution:

  • Step 1: Write the Midpoint equations

    xP+xQ2=xMandyP+yQ2=yM\frac{x_P + x_Q}{2} = x_M \quad \text{and} \quad \frac{y_P + y_Q}{2} = y_M
  • Step 2: Solve for xQx_Q

    −4+xQ2=2−4+xQ=4xQ=4+4=8\begin{aligned} \frac{-4 + x_Q}{2} &= 2 \\ -4 + x_Q &= 4 \\ x_Q &= 4 + 4 = 8 \end{aligned}
  • Step 3: Solve for yQy_Q

    1+yQ2=−31+yQ=−6yQ=−6−1=−7\begin{aligned} \frac{1 + y_Q}{2} &= -3 \\ 1 + y_Q &= -6 \\ y_Q &= -6 - 1 = -7 \end{aligned}

The other endpoint is Q(8,−7)Q(8, -7).


Example 3: Internal and External Division (Section Formula)

Problem Statement: Given A(−2,1)A(-2, 1) and B(3,11)B(3, 11):

  1. Find point PP dividing ABAB internally in the ratio 2:32 : 3.
  2. Find point P′P' dividing ABAB externally in the ratio 2:32 : 3.

Step-by-Step Solution:

  • Part 1: Internal Division (m=2,n=3m = 2, n = 3)

    xP=mx2+nx1m+n=2(3)+3(−2)2+3=6−65=05=0yP=my2+ny1m+n=2(11)+3(1)2+3=22+35=255=5\begin{aligned} x_P &= \frac{m x_2 + n x_1}{m + n} = \frac{2(3) + 3(-2)}{2 + 3} = \frac{6 - 6}{5} = \frac{0}{5} = 0 \\ y_P &= \frac{m y_2 + n y_1}{m + n} = \frac{2(11) + 3(1)}{2 + 3} = \frac{22 + 3}{5} = \frac{25}{5} = 5 \end{aligned}

    The internal division point is P(0,5)P(0, 5).

  • Part 2: External Division (m=2,n=3m = 2, n = 3)

    xP′=mx2−nx1m−n=2(3)−3(−2)2−3=6−(−6)−1=12−1=−12yP′=my2−ny1m−n=2(11)−3(1)2−3=22−3−1=19−1=−19\begin{aligned} x_{P'} &= \frac{m x_2 - n x_1}{m - n} = \frac{2(3) - 3(-2)}{2 - 3} = \frac{6 - (-6)}{-1} = \frac{12}{-1} = -12 \\ y_{P'} &= \frac{m y_2 - n y_1}{m - n} = \frac{2(11) - 3(1)}{2 - 3} = \frac{22 - 3}{-1} = \frac{19}{-1} = -19 \end{aligned}

    The external division point is P′(−12,−19)P'(-12, -19).


6. Common Mistakes & Paper Traps

  1. Sign Errors with Negatives: Writing x2−x1x_2 - x_1 as 5−35 - 3 when x1=−3x_1 = -3. Always use parentheses: 5−(−3)=5+3=85 - (-3) = 5 + 3 = 8.
  2. Squaring Negatives: Calculating (−6)2=−36(-6)^2 = -36. On real paper, the square of any real difference is strictly non-negative: (−6)2=+36(-6)^2 = +36.
  3. Midpoint Subtraction Trap: Subtracting coordinates instead of averaging them. Midpoint is x1+x22\frac{x_1 + x_2}{2}, NOT x2−x12\frac{x_2 - x_1}{2}.
  4. Section Ratio Swap: Multiplying mm by x1x_1 instead of x2x_2. Remember the criss-cross rule: the factor mm applies to point B(x2,y2)B(x_2, y_2)!

7. Pencil & Paper Practice

  1. Problem 1: Find the distance between K(−1,−4)K(-1, -4) and L(3,−1)L(3, -1).
  2. Problem 2: The vertices of a triangle are A(1,2)A(1, 2), B(5,4)B(5, 4), and C(3,8)C(3, 8). Find the length of the median from vertex CC to side ABAB.
  3. Problem 3: In what ratio does the yy-axis divide the line segment joining R(−4,2)R(-4, 2) and S(6,7)S(6, 7)? Find the coordinates of the point of intersection.

Worked Solutions

  • Solution 1:

    d=(3−(−1))2+(−1−(−4))2=(3+1)2+(−1+4)2=42+32=16+9=25=5 units\begin{aligned} d &= \sqrt{(3 - (-1))^2 + (-1 - (-4))^2} \\ &= \sqrt{(3 + 1)^2 + (-1 + 4)^2} \\ &= \sqrt{4^2 + 3^2} = \sqrt{16 + 9} = \sqrt{25} = 5\text{ units} \end{aligned}
  • Solution 2: The median from CC connects CC to the midpoint MM of segment ABAB:

    M=(1+52,  2+42)=(3,3)M = \left( \frac{1 + 5}{2}, \; \frac{2 + 4}{2} \right) = (3, 3)

    Now, calculate the length CMCM between C(3,8)C(3, 8) and M(3,3)M(3, 3):

    CM=(3−3)2+(8−3)2=02+52=25=5 unitsCM = \sqrt{(3 - 3)^2 + (8 - 3)^2} = \sqrt{0^2 + 5^2} = \sqrt{25} = 5\text{ units}
  • Solution 3: Let the point on the yy-axis be P(0,y)P(0, y), and let it divide segment RSRS in the ratio k:1k : 1. By the Section Formula for the xx-coordinate:

    xP=k(xS)+1(xR)k+10=k(6)+1(−4)k+10=6k−4  ⟹  6k=4  ⟹  k=46=23\begin{aligned} x_P &= \frac{k(x_S) + 1(x_R)}{k + 1} \\ 0 &= \frac{k(6) + 1(-4)}{k + 1} \\ 0 &= 6k - 4 \implies 6k = 4 \implies k = \frac{4}{6} = \frac{2}{3} \end{aligned}

    The segment is divided internally in the ratio 2:32 : 3. Now substitute k=23k = \frac{2}{3} (or m=2,n=3m=2, n=3) into the yy-coordinate:

    yP=2(7)+3(2)2+3=14+65=205=4y_P = \frac{2(7) + 3(2)}{2 + 3} = \frac{14 + 6}{5} = \frac{20}{5} = 4

    The point of intersection with the yy-axis is P(0,4)P(0, 4).


Test yourself

What is the distance between the points A(−2,1)A(-2, 1) and B(4,9)B(4, 9)?

  1. 8 units
  2. 10 units
  3. 12 units
  4. 14 units

If the midpoint of segment ABAB is M(3,5)M(3, 5) and AA is (1,2)(1, 2), what are the coordinates of BB?

  1. (2,3.5)(2, 3.5)
  2. (5,8)(5, 8)
  3. (4,7)(4, 7)
  4. (5,9)(5, 9)

Point PP divides the segment joining A(1,3)A(1, 3) and B(6,8)B(6, 8) internally in the ratio 2:32 : 3. What are the coordinates of PP?

  1. (3,5)(3, 5)
  2. (3.5,5.5)(3.5, 5.5)
  3. (4,6)(4, 6)
  4. (2,4)(2, 4)