The Coordinate Plane and the Distance Formula
Plot two dots on graph paper and ask how far apart they are. You could walk across, then up, counting squares the whole way. But the straight line between the dots is shorter than that walk, and you can find its length without ever stretching a ruler along it. The trick is a right triangle hiding between the two points, and the rule that measures it is one you already know.
By the end of this page you can:
- Find the straight-line distance between two points from their coordinates.
- Find the midpoint of a segment by averaging the coordinates.
- Explain why this distance is the Pythagorean theorem in disguise.
The floor. At minimum, compute $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$ for two given points. Every later idea, including the unit circle, leans on this one calculation.
Quick Reference
| Textbook | Stewart, Redlin, Watson, Precalculus: Mathematics for Calculus, 7th ed. |
| Chapter | 1 |
| Section | 1.9 The Coordinate Plane; Graphs of Equations; Circles |
| Open alternate | OpenStax Algebra and Trigonometry 2e, 2.1 The Rectangular Coordinate Systems and Graphs |
| Pages | Page numbers pending faculty verification. |
| Alternate link | https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs |
Stewart 7e Section 1.9 establishes the rectangular coordinate plane, the distance formula, and the midpoint formula, all derived from the geometry of the coordinate grid. The OpenStax alternate is free and openly licensed.
Before You Start
You are ready for this page once you can do the following.
A quick self-check on the one strong prerequisite:
Check your understanding
A right triangle has legs of length 6 and 8. How long is the hypotenuse?
The Idea
To measure the straight-line gap between two points, build a right triangle. The horizontal gap between them is one leg, the vertical gap is the other, and the distance you want is the hypotenuse. The horizontal gap is the difference of the $x$-coordinates, and the vertical gap is the difference of the $y$-coordinates. Feed those two legs into the Pythagorean theorem and out comes the distance.
There is no new idea here, only a new way to write the legs. If you can use $a^2 + b^2 = c^2$, you can already find the distance between any two points. Run the same picture in reverse and you get the midpoint: instead of measuring the gap, stand exactly halfway across and halfway up, which is the average of the two positions.
Hold one image as you read: a right triangle whose slanted side connects the two points. Distance reads that slanted side. Midpoint marks its center.
Try it first: plot $(1, 2)$ and $(4, 6)$ and predict
Walk from $(1, 2)$ to $(4, 6)$ using only horizontal and vertical steps. The horizontal walk is $4 - 1 = 3$ units. The vertical walk is $6 - 2 = 4$ units. Those two walks are the legs of a right triangle, and the slanted line joining the points is its hypotenuse. Predict before computing: is the slanted line longer or shorter than the $3 + 4 = 7$ unit walk? It is shorter, because a straight path cuts the corner. That slanted line is exactly what the distance formula measures.
Prerequisite Hub
Coordinate-plane distance rests on one prerequisite and supports one later skill.
Builds On
| Skill | Why it is needed |
|---|---|
The Pythagorean Theorem and Right Triangles (math142-pythagorean-theorem) |
The distance formula is this theorem applied to coordinate differences. The squares in the formula are the squares of the legs. |
Unlocks
| Skill | What it adds |
|---|---|
The Unit Circle: Sine and Cosine (math142-unit-circle-sine-cosine) |
The unit circle is the set of points at distance $1$ from the origin. Every sine and cosine value comes from this one distance condition. |
graph LR
A["Pythagorean<br/>Theorem"]
B["Coordinate Plane<br/>and Distance Formula"]
C["Unit Circle:<br/>Sine and Cosine"]
A --> B
B --> C
style B fill:#d1fae5,stroke:#a565f0,stroke-width:3px
click A "pythagorean-theorem.html"
click B "coordinate-plane-distance.html"
click C "unit-circle-sine-cosine.html"
No cross-course prerequisites are required for this node.
Quick Reference
| Property | Value |
|---|---|
| Chapter.Section | 1.9 |
| Course | MATH142 |
| Difficulty | Foundational |
| Time | ~35 minutes |
The distance formula. The distance between $(x_1, y_1)$ and $(x_2, y_2)$ is $$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.$$
The midpoint formula. The midpoint of the segment between $(x_1, y_1)$ and $(x_2, y_2)$ is $$M = \left( \frac{x_1 + x_2}{2}, \; \frac{y_1 + y_2}{2} \right).$$
The reading. Distance subtracts the coordinates to measure a gap. Midpoint adds the coordinates to average two positions.
Official Definitions
Distance Formula
Given endpoints $(x_1, y_1)$ and $(x_2, y_2)$, the distance between them is $$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.$$ It is derived from the Pythagorean Theorem.
Source: OpenStax Algebra and Trigonometry 2e, Section 2.1 The Rectangular Coordinate Systems and Graphs.
Midpoint Formula
The midpoint of the segment with endpoints $(x_1, y_1)$ and $(x_2, y_2)$ is $$\left( \frac{x_1 + x_2}{2}, \; \frac{y_1 + y_2}{2} \right).$$
Source: OpenStax Algebra and Trigonometry 2e, Section 2.1 The Rectangular Coordinate Systems and Graphs.
Both formulas come from the same right triangle. The distance formula reads its hypotenuse. The midpoint formula marks the center of its slanted side.
Where the formula comes from
Draw the right triangle whose slanted side joins $(x_1, y_1)$ and $(x_2, y_2)$. The horizontal leg has length $|x_2 - x_1|$, and the vertical leg has length $|y_2 - y_1|$. The Pythagorean theorem gives $d^2 = (\text{horizontal leg})^2 + (\text{vertical leg})^2$, so $$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.$$ The squares remove any need for absolute value signs, since squaring a negative gives a positive. The squares are also why the order of the two points never changes the answer: $(x_2 - x_1)^2$ and $(x_1 - x_2)^2$ are the same number.
Check your understanding
The distance from (1, 2) to (4, 6) involves a horizontal gap of 3 and a vertical gap of 4. What is the straight-line distance?
Worked Examples
Each example uses predict-then-check: estimate the size or sign of the answer first, then compute, then compare.
Example 1: A clean distance
Find the distance between $(1, 2)$ and $(4, 6)$.
Predict. The horizontal gap is $3$ and the vertical gap is $4$. The distance must beat each single leg but fall short of their sum $3 + 4 = 7$. Estimate around $5$.
Compute. $$d = \sqrt{(4 - 1)^2 + (6 - 2)^2} = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5.$$
Check. The result $5$ sits between $4$ and $7$, matching the prediction. This is the $3$-$4$-$5$ right triangle.
Square each difference before adding. A tempting wrong move is $\sqrt{(4 - 1) + (6 - 2)} = \sqrt{7}$, dropping the squares. The squares are what make this the Pythagorean theorem. Without them, the result is not a distance.
Example 2: Order of the points does not matter
Find the distance between $(5, 7)$ and $(2, 3)$, taking the points in the opposite order from how they are listed.
Predict. The gaps are $3$ across and $4$ up again, so the answer is $5$ regardless of which point comes first.
Compute. Take $(2, 3)$ first and $(5, 7)$ second: $$d = \sqrt{(2 - 5)^2 + (3 - 7)^2} = \sqrt{(-3)^2 + (-4)^2} = \sqrt{9 + 16} = \sqrt{25} = 5.$$
Check. The negative differences squared to the same positive values $9$ and $16$, so the distance is $5$ either way. Order is irrelevant because each difference is squared.
Example 3: The midpoint averages the coordinates
Find the midpoint of the segment joining $(2, 3)$ and $(8, 7)$.
Predict. The midpoint sits halfway between the points, so its $x$-coordinate is halfway between $2$ and $8$ (around $5$), and its $y$-coordinate is halfway between $3$ and $7$ (around $5$).
Compute. $$M = \left( \frac{2 + 8}{2}, \; \frac{3 + 7}{2} \right) = \left( \frac{10}{2}, \; \frac{10}{2} \right) = (5, 5).$$
Check. The point $(5, 5)$ lies between the endpoints in both coordinates, matching the prediction.
Midpoint adds; distance subtracts. Do not carry the subtraction from the distance formula into the midpoint. The midpoint is an average, so it uses sums divided by two.
Example 4: Distance with negative coordinates
Find the distance between $(-3, 2)$ and $(1, -1)$.
Predict. Moving from $x = -3$ to $x = 1$ is a horizontal gap of $4$. Moving from $y = 2$ to $y = -1$ is a vertical gap of $3$. The answer is near $5$ again.
Compute. $$d = \sqrt{(1 - (-3))^2 + (-1 - 2)^2} = \sqrt{4^2 + (-3)^2} = \sqrt{16 + 9} = \sqrt{25} = 5.$$
Check. Subtracting a negative widened the horizontal gap correctly to $4$, and the distance came out to $5$. The negative inside the second difference squared away.
Example 5: Building a distance condition (toward the unit circle)
Verify that the point $\left( \dfrac{3}{5}, \dfrac{4}{5} \right)$ is at distance $1$ from the origin.
Predict. Both coordinates are fractions less than $1$, yet a point can still sit a full unit away if it leans into both directions. The $3$-$4$-$5$ triangle scaled down by $5$ should land exactly on distance $1$.
Compute. $$d = \sqrt{\left( \frac{3}{5} - 0 \right)^2 + \left( \frac{4}{5} - 0 \right)^2} = \sqrt{\frac{9}{25} + \frac{16}{25}} = \sqrt{\frac{25}{25}} = \sqrt{1} = 1.$$
Check. The distance is exactly $1$, so this point sits one unit from the origin. The set of all such points is the unit circle, where sine and cosine come from in the next skill.
Two valid paths. The distance computation above is one way. Another is to check whether the coordinates satisfy $x^2 + y^2 = 1$: $\left(\frac{3}{5}\right)^2 + \left(\frac{4}{5}\right)^2 = \frac{9}{25} + \frac{16}{25} = 1$. The two checks are the same statement, since squaring “distance equals $1$” gives $x^2 + y^2 = 1$.
Self-check: try one yourself
Find the distance between $(-2, 1)$ and $(1, 5)$, and find the midpoint of the same two points.
Show answer
Distance: $\sqrt{(1 - (-2))^2 + (5 - 1)^2} = \sqrt{3^2 + 4^2} = \sqrt{25} = 5$.
Midpoint: $\left( \dfrac{-2 + 1}{2}, \dfrac{1 + 5}{2} \right) = \left( -\dfrac{1}{2}, 3 \right)$.
Common Misconceptions
the midpoint is found by subtracting the coordinates, following the same pattern as the distance formula.
This is the concept-image-conflicts-definition error. The two formulas look similar, so the subtraction from distance gets carried into the midpoint.
Predict, then check. Take the segment from $(1, 2)$ to $(5, 8)$. The midpoint should sit in the middle of both coordinates, near $(3, 5)$. Run the wrong subtraction pattern: $\left(\frac{5 - 1}{2}, \frac{8 - 2}{2}\right) = (2, 3)$. That point is not even on the segment; it sits down and to the left of the lower endpoint. The correct average is $\left(\frac{1 + 5}{2}, \frac{2 + 8}{2}\right) = (3, 5)$. The midpoint adds because it averages two positions.
the radius reads straight off the circle equation, so $(x - h)^2 + (y - k)^2 = r$ gives radius $r$.
The right side of a circle equation is $r^2$, not $r$, because the equation comes from squaring a distance.
Predict, then check. Suppose an equation reads $(x - 2)^2 + (y + 1)^2 = 9$. A beginner reads the radius as $9$. The form is $(x - h)^2 + (y - k)^2 = r^2$, so $r^2 = 9$ and $r = \sqrt{9} = 3$. Reading the right side as the radius itself triples the true size.
Check your understanding
What is the midpoint of the segment joining (2, 6) and (8, 2)?
Leveled Practice
Level 1: Direct Application
Problem 1. Find the distance between $(0, 0)$ and $(3, 4)$.
Show answer
$\sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5$.
Problem 2. Find the midpoint of the segment joining $(2, 6)$ and $(8, 2)$.
Show answer
$\left( \dfrac{2 + 8}{2}, \dfrac{6 + 2}{2} \right) = (5, 4)$.
Level 2: Multiple Steps
Problem 3. Find the distance between $(-3, 2)$ and $(1, -1)$.
Show answer
$\sqrt{(1 - (-3))^2 + (-1 - 2)^2} = \sqrt{4^2 + (-3)^2} = \sqrt{16 + 9} = \sqrt{25} = 5$.
Problem 4. Find both the distance between $(-1, -2)$ and $(2, 2)$ and the midpoint of that segment.
Show answer
Distance: $\sqrt{(2 - (-1))^2 + (2 - (-2))^2} = \sqrt{3^2 + 4^2} = \sqrt{25} = 5$.
Midpoint: $\left( \dfrac{-1 + 2}{2}, \dfrac{-2 + 2}{2} \right) = \left( \dfrac{1}{2}, 0 \right)$.
Level 3: Deeper Problems
Problem 5. Show that the point $\left( \dfrac{5}{13}, \dfrac{12}{13} \right)$ is at distance $1$ from the origin.
Show answer
The distance from $(0, 0)$ is $\sqrt{\left( \dfrac{5}{13} \right)^2 + \left( \dfrac{12}{13} \right)^2} = \sqrt{\dfrac{25}{169} + \dfrac{144}{169}} = \sqrt{\dfrac{169}{169}} = \sqrt{1} = 1$. The point is exactly one unit from the origin. This is the $5$-$12$-$13$ triangle scaled down by $13$.
Problem 6. Two points are $(1, 2)$ and $(4, 6)$. Find the midpoint of the segment joining them, then find the distance from the midpoint to $(1, 2)$.
Show answer
Midpoint: $\left( \dfrac{1 + 4}{2}, \dfrac{2 + 6}{2} \right) = \left( \dfrac{5}{2}, 4 \right)$.
Distance from the midpoint to $(1, 2)$: $\sqrt{\left( \dfrac{5}{2} - 1 \right)^2 + (4 - 2)^2} = \sqrt{\left( \dfrac{3}{2} \right)^2 + 2^2} = \sqrt{\dfrac{9}{4} + 4} = \sqrt{\dfrac{25}{4}} = \dfrac{5}{2}$.
This is half the full distance of $5$ between the original points. The midpoint is the same distance from each endpoint.
Level 4: Reasoning and Justification
Problem 7. A classmate claims that the points $(0, 0)$, $(4, 0)$, and $(0, 3)$ form a right triangle whose longest side has length $5$. Decide whether the claim is correct, and justify your decision using distances.
Show answer
Compute all three side lengths.
- From $(0, 0)$ to $(4, 0)$: $\sqrt{(4 - 0)^2 + (0 - 0)^2} = \sqrt{16} = 4$.
- From $(0, 0)$ to $(0, 3)$: $\sqrt{(0 - 0)^2 + (3 - 0)^2} = \sqrt{9} = 3$.
- From $(4, 0)$ to $(0, 3)$: $\sqrt{(0 - 4)^2 + (3 - 0)^2} = \sqrt{16 + 9} = \sqrt{25} = 5$.
The sides are $3$, $4$, and $5$. Since $3^2 + 4^2 = 9 + 16 = 25 = 5^2$, the Pythagorean relation holds, so the triangle is right and the longest side has length $5$. The claim is correct.
Level 5: Extension and Generalization
Problem 8. A point $P = (x, y)$ is equally distant from $(0, 0)$ and from $(6, 0)$. Find an equation that all such points $P$ satisfy, and describe the set of points in words.
Show answer
Set the distance from $P$ to $(0, 0)$ equal to the distance from $P$ to $(6, 0)$: $$\sqrt{(x - 0)^2 + (y - 0)^2} = \sqrt{(x - 6)^2 + (y - 0)^2}.$$
Square both sides: $$x^2 + y^2 = (x - 6)^2 + y^2.$$
Subtract $y^2$ and expand $(x - 6)^2 = x^2 - 12x + 36$: $$x^2 = x^2 - 12x + 36.$$
Subtract $x^2$: $$0 = -12x + 36, \quad \text{so} \quad x = 3.$$
The set of points is the vertical line $x = 3$. Every point equally distant from $(0, 0)$ and $(6, 0)$ has $x$-coordinate $3$, the line standing exactly halfway between them. The midpoint $(3, 0)$ is one such point, and the whole perpendicular line through it is the answer.
Check Yourself
Check your understanding
Find the distance between (-3, 2) and (1, -1).
Check your understanding
Why does the order of the two points not change the distance?
Check your understanding
A circle equation reads (x - 2)^2 + (y + 1)^2 = 9. What is the radius?
Go Deeper (optional)
The bigger picture and where this leads
The unit circle is one step away. Setting the distance from the origin to a fixed value $1$ gives the equation $x^2 + y^2 = 1$, the unit circle. A point on it has coordinates $(\cos\theta, \sin\theta)$, so the Pythagorean identity $\sin^2\theta + \cos^2\theta = 1$ is just this equation with the coordinates renamed. The distance condition here is the algebraic seed of every trigonometric value.
Proof angle. Setting two distances equal and simplifying, as in Problem 8, is a clean way to discover that a balance condition produces a line. Doing the algebra yourself shows the result is a consequence of the distance formula, not a separate fact to memorize.
Where it shows up. Straight-line (Euclidean) distance between data points drives clustering, nearest-neighbor search, mapping, and graphics. Seeing this formula as the Pythagorean theorem makes its extension to many coordinates natural: in higher dimensions you simply add more squared gaps under the same square root.
Further reading. OpenStax Precalculus 2e, Section 5.2, “Unit Circle: Sine and Cosine Functions,” where the distance condition returns as the radius-$1$ circle. https://openstax.org/books/precalculus-2e/pages/5-2-unit-circle-sine-and-cosine-functions
Mastery Checklist
Novice (Level 1-2):
Competent (Level 3-4):
Proficient (Level 5):
Connections
Looking back:
- The Pythagorean Theorem and Right Triangles supplies the $a^2 + b^2 = c^2$ relation that becomes the distance formula once the legs are written as coordinate differences.
Looking ahead:
- The Unit Circle: Sine and Cosine: trigonometry is built on the set of points at distance $1$ from the origin, where a point has coordinates $(\cos\theta, \sin\theta)$.
| Previous | Up | Next |
|---|---|---|
| The Pythagorean Theorem and Right Triangles | MATH 142 Skills Index | The Unit Circle: Sine and Cosine |
Last updated: 2026-06-24