On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Geometry Fundamentals · Grade 9-12

Distance

Distance is the length of the shortest straight path between two points — 'as the crow flies' — always zero or positive.

d=(x2−x1)2+(y2−y1)2

Quick Answer

Distance is the length of the shortest straight path between two points — 'as the crow flies' — always zero or positive. On a coordinate grid you find it by treating the horizontal and vertical gaps as the legs of a right triangle, with the distance as the hypotenuse: d=(x2−x1)2+(y2−y1)2. Use it whenever you need how far apart two locations are, whatever route anyone actually travels.

Why This Matters

Once you can turn two coordinate pairs into one length, you can find the sides of any shape drawn on a grid, check whether a triangle is isosceles or right-angled, find a circle's radius from its centre and one point on it, and compare how far apart places are on a map. Without it, students add the horizontal and vertical gaps and get a length that is too long for every slanted segment.

Intuitive Explanation

Stand at (1,2) on a grid and look at (4,6). Walking there along the grid lines takes 3 right and 4 up, 7 blocks in all. A bird flying straight cuts the corner. Its path is the hypotenuse of a right triangle whose legs are the 3 and the 4, so by the Pythagorean theorem the flight is 32+42=25=5. No route between the two points is shorter than that straight one, and its length is the distance.

The formula d=(x2−x1)2+(y2−y1)2 is that triangle written in symbols. The differences are the legs. Squaring makes them positive, so it does not matter which point you call first, and the square root turns the sum of squares back into a length. A distance can be 0, from a point to itself, but never negative.

Distance is not the length of a trip. If the grid squares are 1 km and a road between those points winds for 8 km, the trip is 8 km but the distance is still 5 km. Distance is also not displacement: displacement says 3 right and 4 up, a direction as well as a size, while distance keeps only the size, 5. When a problem asks how far someone travelled along a route, add the pieces of the route instead.

Think of it like this. Pull a string tight between two pins on a corkboard: it snaps into the shortest path, and its length is the distance. Any slack, like a road that wanders, makes the string longer, never shorter, which is why no route can beat the distance.

Core idea. Distance is the length of the shortest, straight path between two points, always a non-negative number.


When to Use

Reach for distance when a problem asks how far apart two points are, gives two coordinate pairs and wants a length, or says straight-line or as the crow flies. Subtract coordinates, square, add and take the root. If it asks how far someone travelled along a route, add the lengths of the route's pieces instead. If it wants the direction too, use displacement or a vector; for the whole way around a shape, use perimeter.

Tip. Ask: Am I finding the shortest straight-line length between two specific points?

How to Recognize It

Check whether you need how far apart two points are, how far something travelled, or the gap together with its direction, before you subtract coordinates.

  1. Does the answer need a direction as well as a length?

    If yes, it is a displacement, a vector such as 5 km north-east. Distance keeps only the size, so it is never negative and does not care which point you start from: d(A,B)=d(B,A).

  2. Did something follow a route with turns, and does the question ask how far it went?

    If yes, add the lengths of the pieces: that is distance along the path. Walking 5 km east and then 12 km north covers 17 km, while the straight distance between start and end is only 13 km.

  3. Are both points given by their coordinates?

    If yes, square the two gaps, add, and take the root: from (−2,1) to (4,9) the gaps are 6 and 8, giving 10. Squaring removes the signs, so either point can come first.

  4. Do the two points lie on the same horizontal or vertical line?

    If yes, skip the square root: the distance is the difference in the one coordinate that changes, taken as an absolute value. From (3,−2) to (3,5) the distance is ∣5−(−2)∣=7.

Distance compared with Displacement, Perimeter, and Distance along a path

Distance, displacement, perimeter and path length all measure how far, often with the same numbers. Ask whether direction matters, whether the route counts, and whether you go between two points or all the way around a shape.

Distance

Meaning
Use this when you need the shortest straight-line length between two points.
Key test
Am I finding the shortest straight-line length between two specific points?
Formula
d=(x2−x1)2+(y2−y1)2
Example
Find the distance between A=(1,2) and B=(4,6).

Displacement

Meaning
Includes direction; distance is only the magnitude, no direction.
Key test
Use in physics when direction of separation matters.
Example
5 km east is displacement; 5 km is distance

Perimeter

Meaning
The total around a shape's boundary, not the gap between two points.
Key test
Use when adding side lengths around a figure.
Formula
P=sum of sides
Example
Around a rectangle

Distance along a path

Meaning
The length traveled on a curved or bent route, longer than the straight-line distance.
Key test
Use when you must follow an actual road, not go straight.
Example
Driving 8 km on winding roads between towns 5 km apart

Formula & Notation

d=(x2−x1)2+(y2−y1)2
Euclidean distance: d(P,Q)=∥P−Q∥=∑i=1n(pi−qi)2 for P,Q∈Rn; satisfies metric axioms: d(P,Q)≥0, d(P,Q)=0  ⟺  P=Q, d(P,Q)=d(Q,P), d(P,R)≤d(P,Q)+d(Q,R)

How to read it: d(A,B) or ∣AB∣ denotes the distance between points A and B

Worked Examples

Example 1 — Distance between two points

Easy

Find the distance between A=(1,2) and B=(4,6).
Show the steps and the answer
  1. Find the horizontal gap: x2−x1=4−1=3.

    This is one leg of the right triangle whose hypotenuse is segment AB.

  2. Find the vertical gap: y2−y1=6−2=4.

    This is the other leg. The legs meet at the corner (4,2) at a right angle.

  3. Apply the Pythagorean theorem: d=32+42=9+16=25.

    The legs are squared before adding, because the theorem relates the squares on the sides, not the sides themselves.

  4. Take the positive root: d=5. Compare with the grid walk, 3+4=7.

    A distance is never negative, and the straight path must be shorter than walking along both legs.

Answer: d=5

Takeaway: On a grid, distance is the hypotenuse built from the horizontal and vertical gaps, and it is always shorter than the two gaps added up unless one of them is 0.

Example 2 — The road, not the crow

Standard

Two towns are at (1,2) and (4,6), but the road between them winds for 8 km. What is the distance between the towns?
Show the steps and the answer
  1. Separate the two lengths in the problem: the road, 8 km, and the gap between the towns.

    The road is one particular route; distance is the shortest of all possible routes.

  2. Compute the straight-line gap from the coordinates: (4−1)2+(6−2)2=9+16=5.

    The coordinates fix where the towns are, and nothing about the road changes that.

  3. Compare: 5<8.

    Every route other than the straight segment is longer, so a road can never be shorter than the distance. If it were, the data would be wrong.

Answer: 5 units (not 8)

Takeaway: A route's length depends on the route; distance depends only on the two endpoints. Asked for the drive, answer 8 km; asked for the distance, answer 5.

Example 3 — Find the mistake: adding the gaps

Application

Find the distance between P=(−2,1) and Q=(3,13). Sam writes: "d=(3−(−2))+(13−1)=5+12=17." Find the mistake and correct it.
Show the steps and the answer
  1. Recheck the gaps: 3−(−2)=5 and 13−1=12.

    Sam's gaps are right, including the negative: going from −2 to 3 is 5 steps.

  2. Spot the error: Sam added the gaps, 5+12=17.

    That is the length of the grid walk, 5 right then 12 up, not the straight path.

  3. Square, add, then take the root: d=52+122=25+144=169=13.

    The straight segment is the hypotenuse of a right triangle with legs 5 and 12.

  4. Check the size: 12<13<17.

    A hypotenuse must be longer than either leg but shorter than the two legs together.

Answer: d=13

Takeaway: Add the squares of the gaps, not the gaps; the plain sum is the grid walk, which is never shorter than the distance.

Where You'll See It

  • Drone delivery range

    A drone base is at (0,0) on a map grid in kilometres and a house is at (6,8). The roads add up to 6+8=14 km, but the drone flies straight: 36+64=10 km. With a 12 km range it can reach the house, but it cannot fly there and back on one charge.

  • Is a phone in tower range?

    A cell tower at (2,3) on a km grid reaches 5 km. A phone at (6,5) is 42+22=20≈4.5 km away and gets signal; a phone at (5,8) is 32+52=34≈5.8 km away and does not.

  • Catcher's throw to second base

    A baseball diamond is a square with 90 ft sides. The throw from home plate to second base is the diagonal, 902+902=902≈127 ft, while a runner going by way of first base covers 180 ft.

Common Mistakes

  1. The slip: Reporting a negative distance

    Instead: distance is always non-negative.

  2. The slip: Forgetting to square the differences before adding

    Instead: the formula is (Δx)2+(Δy)2, not Δx+Δy.

  3. The slip: Measuring along a bent path instead of straight

    Instead: distance is the shortest, straight-line length.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Find the distance between (−2,1) and (4,9).

    Hint: Find the change in x and the change in y first.

  2. Find the distance between (3,−1) and (−2,4), exactly and to one decimal place.

    Hint: Square each difference, even the negative one.

  3. Find the distance between (0,0,0) and (2,3,6) in 3D.

    Hint: Add a third squared difference for z.

  4. Is the triangle with vertices A(0,0), B(4,0) and C(2,3) isosceles?

    Hint: Find all three side lengths.

  5. A runner goes 3 km east and then 4 km north. Is the distance from start to finish 7 km or 5 km?

    Hint: Distance is the straight line, not the route.

  6. A student finds the distance from (2,−1) to (14,4) as "12+5=17." Correct the mistake.

    Hint: Use the distance formula, with squares and a square root.

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Is straight-line distance the right distance in a city?

Not for travel. In a city laid out in square blocks you cannot cut through buildings, so the walking distance is the sum of the east-west and north-south moves, called taxicab distance. Going 3 blocks east and 4 blocks north is 7 blocks by taxicab but 5 blocks as the crow flies. Both are genuine distances, just with different rules about which paths are allowed.

How do you find the distance between two points in 3D?

Add a third squared gap: d=(x2−x1)2+(y2−y1)2+(z2−z1)2d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}. It is the Pythagorean theorem applied twice, once across the floor and once up to the height. From (0,0,0)(0,0,0) to (2,3,6)(2,3,6) the distance is 4+9+36=49=7\sqrt{4+9+36}=\sqrt{49}=7. You need this version whenever height changes too, such as the gap between a drone in the air and its pilot on the ground.

How is the distance from a point to a line measured?

Along the perpendicular, the path that meets the line at a right angle, because that is the shortest of all paths from the point to the line. Any slanted path is the hypotenuse of a right triangle that has the perpendicular as a leg, so it is longer. That is why the height of a triangle is drawn at right angles to its base.

How far away is the horizon?

Your line of sight just grazes the Earth, meeting the radius at a right angle, so the Pythagorean theorem gives d≈2Rhd\approx\sqrt{2Rh}, where R≈6371R\approx6371 km is the Earth's radius and hh is your eye height. For eyes 1.7 m up, d≈2×6,371,000×1.7≈4700d\approx\sqrt{2\times6{,}371{,}000\times1.7}\approx4700 m, about 4.7 km. From the top of a 100 m cliff it grows to about 36 km.

Learning Path

Distance

You are here

You need the Pythagorean Theorem first: every distance on a grid is the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps. This concept adds the ideas that distance is the shortest route and is never negative. Next, the Distance Formula packages the computation for any two points, including in 3D, and powers circle equations and checks of side lengths.

See Also