IB MATHEMATICS: ANALYSIS AND APPROACHES • GEOMETRY AND TRIGONOMETRY

Coordinate Geometry — SL 3.1 Coordinate geometry in 2D/3D (distance, midpoint)

Master the formulas that measure length and locate centres in two- and three-dimensional space.

Historical Context & Motivation

For thousands of years, geometry and algebra were treated as entirely separate branches of mathematics. Greek mathematicians like Euclid could prove elegant theorems about shapes, but they had no systematic way to attach numbers to every point in space. Meanwhile, algebraists could solve equations without any visual picture of what their solutions looked like. The breakthrough came when mathematicians realised they could merge these two worlds—placing shapes on a numbered grid so that every geometric question could be answered with an equation, and every equation could be drawn as a curve.

This fusion is called coordinate geometry (also known as analytic geometry), and it transformed how we think about distance, position, and shape. The timeline below traces the key moments that led to the tools you will use in SL 3.1.

c. 300 BCE
Euclid's Elements
Euclid formalised geometry using axioms and logical proofs. Distance was understood through constructions with compass and straightedge, but there was no numerical coordinate system.
1637
Descartes Publishes La Géométrie
René Descartes introduced the idea of placing perpendicular number lines (axes) on a plane, linking every geometric point to an ordered pair (x, y). This is why we call the standard grid the Cartesian plane.
1640s
Fermat's Coordinate Methods
Pierre de Fermat independently developed coordinate techniques and used them to study curves. His work, combined with Descartes', established analytic geometry as a mainstream field.
19th Century
Extension to Three Dimensions
Mathematicians generalised the Cartesian system to three axes (x, y, z), enabling distance and midpoint calculations in 3D space—essential for physics, engineering, and eventually computer graphics.

The central question that coordinate geometry answers is deceptively simple: Given two points described by numbers, how far apart are they, and where is the point exactly halfway between them? In this lesson you will learn the formulas for distance and midpoint in both 2D and 3D, and you will see why these formulas are really just the Pythagorean theorem in disguise.

Core Principles & Definitions

Before diving into formulas, it is important to understand the foundational ideas that make coordinate geometry work. Every calculation in this topic rests on a small set of principles, each of which connects algebra to the geometric world you can visualise.

1

Ordered Pairs & Triples

In 2D, every point is described by (x, y). In 3D, a third coordinate is added: (x, y, z). The order matters—(3, 5) and (5, 3) are different points.
2

The Pythagorean Theorem

The distance formula is derived directly from the Pythagorean theorem. The horizontal and vertical differences between two points form the legs of a right triangle, and the distance is the hypotenuse.
3

Distance = Length of a Segment

The distance between two points is always a non-negative real number representing the straight-line (Euclidean) length of the segment joining them.
4

Midpoint = Average of Coordinates

The midpoint of a segment is found by averaging the x-coordinates and the y-coordinates (and z-coordinates in 3D) of the endpoints. It is the point that divides the segment into two equal halves.
5

Seamless 2D → 3D Extension

Every 2D formula extends to 3D by adding the z-component in exactly the same pattern. Once you master the 2D version, the 3D version is a natural next step.
KEY TAKEAWAY
Think of finding distance like measuring a road trip on a map. You cannot drive diagonally through buildings, so you first go east/west (the x-difference) and then north/south (the y-difference). The Pythagorean theorem then tells you how far the straight-line shortcut would be. For 3D, imagine an elevator ride (the z-difference) added on top of that flat road trip—same idea, one more dimension.

Visual Explanation — Distance in 2D

The diagram below shows two points, A(1, 2) and B(7, 6), plotted on a Cartesian plane. A right triangle is constructed by drawing horizontal and vertical legs from one point to the other. The horizontal leg has length |7 − 1| = 6, and the vertical leg has length |6 − 2| = 4. The distance AB is the hypotenuse of this right triangle.

Points A(1, 2) and B(7, 6) are joined by a segment (cyan). The dashed amber leg shows Δx = 6 and the dashed emerald leg shows Δy = 4. The orange dot marks the midpoint M(4, 4).

Notice how the right-angle box at the corner of the triangle confirms that Δx and Δy are perpendicular. This is the geometric heart of the distance formula: you always form a right triangle and apply the Pythagorean theorem. The midpoint M sits exactly halfway along both the horizontal and vertical directions, which is why you simply average the coordinates.

Mathematical Framework

Here are the four key formulas you need for SL 3.1. Each one is given in its general form, with all variables defined. Study the pattern: the 3D version always adds one more squared difference or one more averaged coordinate.

DISTANCE IN 2D
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
where (x₁, y₁) and (x₂, y₂) are the coordinates of two points in the plane, and d is the straight-line distance between them.
DISTANCE IN 3D
d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]
where (x₁, y₁, z₁) and (x₂, y₂, z₂) are the coordinates of two points in space. The extra (z₂ − z₁)² term accounts for the vertical (depth) separation.
MIDPOINT IN 2D
M = ( (x₁ + x₂) / 2 , (y₁ + y₂) / 2 )
The midpoint M is the arithmetic mean of the x-values and the arithmetic mean of the y-values. It lies exactly halfway along the segment.
MIDPOINT IN 3D
M = ( (x₁ + x₂) / 2 , (y₁ + y₂) / 2 , (z₁ + z₂) / 2 )
The same averaging principle extends to three dimensions by also averaging the z-coordinates.
📘 IB Formula Booklet Note
The distance and midpoint formulas for 2D and 3D are both provided in the IB Mathematics: Analysis and Approaches formula booklet. You do not need to memorise them, but you do need to understand them well enough to apply them quickly and correctly under exam conditions.

Extending to Three Dimensions

Moving from 2D to 3D can feel intimidating, but the geometry is essentially the same. In two dimensions, the distance formula uses a single right triangle. In three dimensions, you stack two right triangles together. First you find the distance across the xy-plane (using Δx and Δy), then you treat that result as one leg of a second right triangle whose other leg is Δz. The diagram below illustrates this two-step construction.

The 3D distance is built in two stages. Step 1 finds the flat distance dxy across the base plane using Δx and Δy. Step 2 uses dxy and Δz as legs of a new right triangle to find the full 3D distance.

This two-step reasoning is exactly why the 3D formula looks the way it does: d = √(Δx² + Δy² + Δz²). Algebraically, if you substitute dxy² = Δx² + Δy² into d² = dxy² + Δz², you get d² = Δx² + Δy² + Δz², which is the formula from Section 4. Understanding the derivation means you can always reconstruct the formula even under pressure.

Side-by-side comparison of 2D and 3D formulas
Formula2D Version3D Version
Distance√[(x₂−x₁)² + (y₂−y₁)²]√[(x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²]
Midpoint((x₁+x₂)/2, (y₁+y₂)/2)((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2)
Key ideaOne right triangleTwo stacked right triangles

Worked Examples

Example 1 — Distance & Midpoint in 2D

Find the distance between A(−3, 4) and B(5, −2), and determine the midpoint of segment AB.

2D Distance & Midpoint
1
Step 1 — Identify the coordinatesLet (x₁, y₁) = (−3, 4) and (x₂, y₂) = (5, −2).
2
Step 2 — Find the differencesΔx = x₂ − x₁ = 5 − (−3) = 8. Δy = y₂ − y₁ = (−2) − 4 = −6.
3
Step 3 — Apply the distance formulad = √(Δx² + Δy²) = √(8² + (−6)²) = √(64 + 36) = √100 = 10.
d = 10 units
4
Step 4 — Apply the midpoint formulaM = ((x₁ + x₂)/2, (y₁ + y₂)/2) = ((−3 + 5)/2, (4 + (−2))/2) = (2/2, 2/2) = (1, 1).
M = (1, 1)

Example 2 — Distance in 3D

Find the distance between P(2, −1, 3) and Q(6, 3, −1).

3D Distance
1
Step 1 — Identify the coordinatesLet (x₁, y₁, z₁) = (2, −1, 3) and (x₂, y₂, z₂) = (6, 3, −1).
2
Step 2 — Find the differencesΔx = 6 − 2 = 4. Δy = 3 − (−1) = 4. Δz = −1 − 3 = −4.
3
Step 3 — Square and sumΔx² + Δy² + Δz² = 16 + 16 + 16 = 48.
4
Step 4 — Take the square rootd = √48 = √(16 × 3) = 4√3 ≈ 6.93.
d = 4√3 ≈ 6.93 units

Common Mistakes & Exam Tips

Even strong students make avoidable errors with the distance and midpoint formulas. The table below lists the most frequent mistakes alongside the correct approach. Reviewing these before an exam can save you easy marks.

Top five mistakes in distance and midpoint problems
Common MistakeWhy It's WrongCorrect Approach
Forgetting to square the differencesWriting √(Δx + Δy) instead of √(Δx² + Δy²) gives a completely different value and can even produce a negative under the radical.Always square each difference before adding.
Sign errors with negativesSubtracting a negative number, e.g. 5 − (−3), is frequently miscalculated as 5 − 3 = 2 instead of 8.Use brackets: x₂ − (x₁). Subtracting a negative means adding.
Averaging differences instead of coordinates for midpointComputing (Δx/2, Δy/2) gives a vector, not a point. The midpoint must be a location in the coordinate system.Average the actual x-values: (x₁ + x₂)/2.
Leaving answer as √(decimal)IB examiners expect exact values where possible. Writing √6.25 instead of 2.5 loses clarity.Simplify surds: √48 = 4√3. Give exact form first, then approximate if asked.
Mixing up distance and midpointApplying the midpoint formula when asked for distance (or vice versa) wastes time and earns zero marks.Read the question carefully. Distance → subtract, square, sum, root. Midpoint → add, divide by 2.
🎯 EXAM STRATEGY
When an IB question involves finding a missing coordinate (e.g., "the midpoint of AB is M(3, 5); find B"), set up the midpoint formula and solve for the unknown. These questions are common on Paper 1 and are worth easy marks if you stay organised. Write out every substitution line—method marks are awarded even if the final answer has a small arithmetic slip.

Connections to Advanced Topics

The distance and midpoint formulas are not isolated facts—they form the foundation for many topics you will meet later in the IB course and beyond. Understanding how these building blocks fit into the bigger picture will deepen your grasp of the syllabus and help you spot connections in unfamiliar exam questions.

How SL 3.1 connects to later topics
SL 3.1 ConceptWhere It Leads
Distance in 2DEquation of a circle: (x − h)² + (y − k)² = r² is just the distance formula set equal to the radius.
Distance in 3DEquation of a sphere, vector magnitudes, and 3D applications in physics (kinematics, fields).
MidpointPerpendicular bisectors, Voronoi diagrams, and medians/centroids of triangles in later geometry.
Pythagorean derivationIn HL, the same logic extends to n-dimensional Euclidean distance and inner-product spaces in linear algebra.

If you continue to HL or university mathematics, you will see that the distance formula generalises further—to curved surfaces, to higher dimensions, and even to abstract spaces where "distance" is defined by different rules (called metrics). For now, the key insight is that mastering the simple Cartesian distance and midpoint puts you on solid ground for every one of these extensions.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain, in your own words, why the distance formula works. What geometric theorem is it based on, and what role do Δx and Δy play in the construction?
PROBLEM 2BASIC CALCULATION
Find the distance between P(3, 7) and Q(−1, 4), and find the midpoint of PQ. Give the distance in exact (surd) form.
PROBLEM 3INTERMEDIATE
The midpoint of segment AB is M(4, −1). If A = (−2, 5), find the coordinates of B.
PROBLEM 4APPLIED
A drone flies from point A(1, 3, 10) to point B(7, −1, 2) in a straight line. The coordinates are in metres. How far does the drone travel? Also, at what point is the drone exactly halfway through its journey?
PROBLEM 5CRITICAL THINKING
Three points are given: A(0, 0), B(6, 0), and C(6, 8). Show that the midpoint of the hypotenuse AC is equidistant from all three vertices. What does this tell you about the circumscribed circle of a right triangle?

Lesson Summary

In this lesson you learned the core tools of coordinate geometry as required by IB SL 3.1. The distance formula in 2D, d = √[(x₂ − x₁)² + (y₂ − y₁)²], is a direct application of the Pythagorean theorem, and it extends naturally to 3D by adding a (z₂ − z₁)² term under the radical. The midpoint formula finds the centre of a segment by averaging the coordinates of its endpoints: M = ((x₁ + x₂)/2, (y₁ + y₂)/2) in 2D, with an additional z-average in 3D.

Key exam strategies include watching out for sign errors with negatives, always squaring differences before adding, and simplifying surds to exact form. These formulas connect forward to the equation of a circle, perpendicular bisectors, and vector magnitudes—making them one of the most versatile tools in your IB geometry toolkit.

Varsity Tutors • IB Mathematics: Analysis and Approaches • Coordinate Geometry — SL 3.1 Coordinate geometry in 2D/3D (distance, midpoint)