📘 CodingMarble Learn

Coordinate Geometry: Distance and Section Formula

Every point on a flat plane has an address (x, y). The distance between A(x₁, y₁) and B(x₂, y₂) is d = √[(x₂ − x₁)² + (y₂ − y₁)²]; it is just Pythagoras on the x-gap and the y-gap. A point P that cuts AB inside in the ratio m : n is P = ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n)). When m = n, P is the midpoint.

🎬 Step-by-step story

  1. Here is a grid with two points, A(1, 1) and B(4, 5). We want to know how far apart they are.
  2. First walk straight to the right from A. Count the blue squares: 4 − 1 = 3. This is the x-gap.
  3. Now walk straight up to B. Count the green squares: 5 − 1 = 4. This is the y-gap. The two walks make a right angle.
  4. The slanted line AB is the long side of a right triangle. By Pythagoras, AB = √(3² + 4²) = √25 = 5. That is the distance formula.
  5. Now B moves to (7, 4). We cut AB into 2 + 1 = 3 equal pieces. P sits 2 pieces from A and 1 piece from B, so P divides AB in 2 : 1. P = (5, 3).
  6. Free play: move B with the sliders and change m and n. The distance and the point P update below the grid.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why do we subtract the coordinates?

Subtracting tells us how many squares apart the points are. The blue tiles in the 3D are exactly x₂ − x₁.

What if the gap comes out negative?

A negative gap only means you walk left or down. When you square it, the sign goes away, so the distance is always positive.

Where does the square root come from?

Pythagoras gives AB² = gap² + gap². To get AB itself, not AB², you take the square root. See the purple line become 5 in step 3.

Why does m go with x₂ and not x₁?

P is m pieces from A, so it leans m parts toward B. The bigger m is, the closer P gets to B, so m must multiply B's coordinate.

Is the midpoint just the section formula?

Yes. Set m = n = 1 in the last step: P sits exactly in the middle and the formula becomes the average.

Does the distance change if I swap A and B?

No. (x₁ − x₂)² is the same as (x₂ − x₁)². Try moving B around A in free play: the distance only depends on the gaps.

Points have an address: (x, y)

Draw two number lines that cross at a right angle. The flat one is the x-axis. The standing one is the y-axis. They meet at the origin O(0, 0).

Every point has two numbers. The first number (x, called the abscissa) says how far to go right or left. The second number (y, called the ordinate) says how far to go up or down. So (3, 2) means 3 right, then 2 up.

Distance formula

Take A(x₁, y₁) and B(x₂, y₂). Walk from A straight across until you are under B. That walk is the x-gap, x₂ − x₁. Then walk straight up to B. That walk is the y-gap, y₂ − y₁. The two walks meet at a right angle, so AB is the hypotenuse of a right triangle.

By Pythagoras: AB = √[(x₂ − x₁)² + (y₂ − y₁)²].

A negative gap does not matter, because squaring makes it positive. Distance of P(x, y) from the origin is √(x² + y²).

Using the distance formula

Section formula (internal division)

A point P lies on segment AB, between A and B. If AP : PB = m : n, we say P divides AB internally in the ratio m : n.

Think of AB cut into m + n equal pieces. P is m pieces from A. So P moves m/(m + n) of the way from A to B. That gives

P = ( (m·x₂ + n·x₁)/(m + n) , (m·y₂ + n·y₁)/(m + n) )

Why it works: draw small right triangles under AP and PB. They have the same angles, so they are similar, and their gaps are in the ratio m : n. (See Similar triangles.)

Midpoint formula

If m = n, P is the midpoint: ((x₁ + x₂)/2, (y₁ + y₂)/2). Just take the average of the x's and of the y's.

Finding the ratio

If the ratio is not known, call it k : 1. Put it in the formula, compare with the given x (or y) and solve for k. To find where the x-axis cuts AB, set y = 0.

Points of trisection

Two points cut AB into three equal parts. They divide AB in 1 : 2 and 2 : 1.

Try it yourself (practical)

At home: Tape two lines on a tiled floor as x and y axes. Stand at tile (1, 1). Put a slipper on tile (4, 5). Count 3 tiles across and 4 tiles up. Now stretch a string straight from you to the slipper and measure it in tile widths: it is 5. You just checked the distance formula.

In the 3D: go to the last step. Set B to (7, 1) and m : n to 1 : 1. Predict P before you look. (Answer: (4, 1), the midpoint.)

Key formulas and definitions

Worked examples

1. Find the distance between A(1, 1) and B(4, 5).

x-gap = 4 − 1 = 3. y-gap = 5 − 1 = 4. AB = √(3² + 4²) = √(9 + 16) = √25 = 5 units.

2. Find the distance of P(−6, 8) from the origin.

OP = √[(−6)² + 8²] = √(36 + 64) = √100 = 10 units.

3. Find the midpoint of A(2, −3) and B(6, 7).

x = (2 + 6)/2 = 4. y = (−3 + 7)/2 = 2. Midpoint = (4, 2).

4. Find the point that divides A(1, 1) and B(7, 4) internally in the ratio 2 : 1.

m = 2, n = 1. x = (2×7 + 1×1)/3 = 15/3 = 5. y = (2×4 + 1×1)/3 = 9/3 = 3. P = (5, 3).

5. Are the points A(1, 2), B(3, 6) and C(4, 8) on one straight line?

AB = √(4 + 16) = √20 = 2√5. BC = √(1 + 4) = √5. AC = √(9 + 36) = √45 = 3√5. AB + BC = 2√5 + √5 = 3√5 = AC. So yes, they are collinear.

6. Find the point on the x-axis that is equidistant from A(2, −5) and B(−2, 9).

The point is P(x, 0). PA² = PB²: (x − 2)² + 25 = (x + 2)² + 81. x² − 4x + 4 + 25 = x² + 4x + 4 + 81. −8x = 56, so x = −7. P = (−7, 0).

7. In what ratio does the point (−1, 6) divide the join of A(−3, 10) and B(6, −8)?

Take the ratio k : 1. x = (6k − 3)/(k + 1) = −1. So 6k − 3 = −k − 1, 7k = 2, k = 2/7. Ratio = 2 : 7. Check y: (−8×2 + 10×7)/9 = 54/9 = 6 ✓.

8. Find the points of trisection of the segment joining A(2, −2) and B(−7, 4).

P divides AB in 1 : 2: P = ((−7 + 4)/3, (4 − 4)/3) = (−1, 0). Q divides AB in 2 : 1: Q = ((−14 + 2)/3, (8 − 2)/3) = (−4, 2).

Common mistakes

Practice quiz

1. The distance between (0, 0) and (3, 4) is:
2. The midpoint of (2, 4) and (6, 8) is:
3. In the section formula, the point P divides AB internally in m : n. The x-coordinate of P is:
4. The distance of (−5, 12) from the origin is:
5. The x-axis divides the join of A(2, −3) and B(5, 6) in the ratio:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the distance formula in simple words?

Find how far apart the points are across (x-gap) and up (y-gap). Square both, add them, and take the square root. It is Pythagoras on a grid.

What is the difference between the section formula and the midpoint formula?

The section formula finds a point that cuts a segment in any ratio m : n. The midpoint formula is the special case m = n = 1, so it just averages the coordinates.

How many marks does coordinate geometry carry in CBSE Class 10?

The Coordinate Geometry unit carries about 6 marks in the CBSE Class 10 Maths Standard paper. Distance and section formula questions come almost every year.

Where this is taught

Canada (Ontario)Grade 10Analytic Geometry
ItalySecondaria di secondo grado – classe 1ªGeometry
ItalySecondaria di secondo grado – classe 1ªGeometry
ItalySecondaria di secondo grado – classe 1ªGeometry
ItalySecondaria di secondo grado – classe 2ªGeometry
ItalySecondaria di secondo grado – classe 2ªGeometry
ItalySecondaria di secondo grado – classe 2ªGeometry
NetherlandsHAVO 4 (bovenbouw, 2e fase)Geometric calculations
Spain4º ESOSpatial sense
Spain1º BachilleratoSpatial Sense
CBSE (India)Class 10Coordinate Geometry
CBSE (India)Class 10Coordinate Geometry
USA (Common Core, NGSS, AP)Grade 9Connecting algebra and geometry through coordinates
USA (Common Core, NGSS, AP)Grade 10Connecting algebra and geometry through coordinates
Japan高校2年Figures and equations
South Korea고등학교 1학년Equations of figures
South Korea고등학교 1학년Equations of figures
FranceSecondeAutomatic skills
FranceSecondeGeometry
FrancePremièreGeometry
Russia9 классCoordinate method
Russia9 классCoordinate method

Learn first

Learn next

Related lessons

All Maths lessons