Measuring Distance
Learning objectives
- Compute the distance between two points on the number line using absolute value
- Compute the distance between two points in the coordinate plane
- State and apply the properties of distance: non-negativity, symmetry, and the triangle inequality
How far apart are two things? The question sounds trivial, but the moment you sharpen it, you discover that "distance" is the most-used operation in mathematics. Every theorem about circles, every notion of "close enough" in calculus, every Euclidean intuition rests on knowing how to measure the gap between two points. In this section we package that idea into a single formula that works on the number line and in the plane.
Distance on the number line
Two integers and live somewhere on the same horizontal line. To measure the gap between them, count the steps from one to the other. Stepping right or left should not change the count, only the magnitude matters. That is why we use absolute value:
For example, . The subtraction can be done in either order: because squaring (which absolute value secretly does) erases sign.
Distance in the plane, Pythagoras shows up
For points and , the horizontal gap is and the vertical gap is . These two gaps form the legs of a right triangle whose hypotenuse is the straight-line distance from to . By the Pythagorean theorem:
Squaring inside the radical handles the sign issue automatically, we do not need to wrap the differences in absolute values, because . The order of and does not matter.
- GPS Navigation: Your phone solves a distance-minimisation problem against four satellite signals to pin down your location; the triangle inequality is what bounds the worst-case error from each individual signal.
- Robotics: A robot arm planning a collision-free path computes Euclidean distances between its end-effector and obstacles thousands of times per second; the symmetry of distance lets it cache one direction's measurement.
- Genomics: Edit distance, how far apart two DNA sequences are, is a non-Euclidean distance metric, but it still satisfies the same three properties (non-negative, symmetric, triangle inequality).
Three properties every distance must satisfy
Mathematicians abstract this idea into a list of properties, called a metric. Any function that pairs two points with a number is a distance if it obeys:
1. Non-negativity. , with equality only when . A negative distance is meaningless.
2. Symmetry. . Walking from to covers the same ground as walking back.
3. Triangle inequality. . The detour through is never shorter than the straight path. In Euclidean geometry, equality holds only when lies on the segment from to .
Try it
- Place , and , . Predict first: what is the distance from the origin to ? Place the points and confirm the readout shows for the famous 3-4-5 triangle.
- Now drag , with pinned at the origin. Notice the distance scales with the spread of the coordinates.
- Place , and , . Before placing them: the -coordinates match, so what should the distance be? Place the points and confirm .
A trap to watch for
Beginners frequently write . This is wrong, the right-hand side is the so-called "taxicab" distance, the length of a path that goes right then up (like a New York taxi confined to a grid). The Euclidean distance is the diagonal, which is always shorter than the sum of the legs. Concretely: from to the taxicab distance is , but the Euclidean distance is . The square root is what bends the legs into a hypotenuse.
What you now know
You can compute the distance between any two points on the line or in the plane, and you can recognise the three properties that distinguish a metric from an arbitrary numerical pairing. The next section uses these tools to talk about angles, the other half of Euclidean geometry, and Pythagoras' theorem itself takes centre stage one section after that.
Quick check
Mark section complete →
References
- Lang, S. (1971). Basic Mathematics. Springer. Chapter 5, §1, the original motivation-first treatment of distance.
- Euclid (c. 300 BCE). Elements, Book I, Propositions 47-48 (Heath translation, Dover, 1956). The geometric source of the distance formula via Pythagoras.
- Coxeter, H. S. M. (1969). Introduction to Geometry, 2nd ed. Wiley. Chapter 1 develops Euclidean distance from synthetic axioms.
- Stewart, J. (2015). Calculus, 8th ed. Cengage. Appendix B reviews distance and the algebra-geometry bridge that this section establishes.