Points, Lines and Angles

The Triangle Inequality as the Rule That a Straight Path Is Shortest

Understand why one side of a triangle is shorter than the other two combined, with proofs, uses and what changes off the plane.

Key takeaways

  • Any side of a triangle is shorter than the sum of the other two sides.
  • Equality AC = AB + BC holds only when B lies on the segment from A to C.
  • Three lengths form a triangle exactly when the longest is less than the sum of the other two.
  • The rule extends to paths with many corners, which are never shorter than the straight segment.
  • Other notions of distance are expected to obey the same rule, and not every formula passes.

The triangle inequality says that for any three points A, B and C,

AC ≤ AB + BC.

Going straight from A to C is never longer than going by way of B. Equality happens exactly when B lies on segment AC, so that the "detour" is no detour at all. For a genuine triangle, each side is strictly shorter than the sum of the other two.

A proof by dropping a perpendicular

Let A, B and C be three points, with A and C different. Drop a perpendicular from B to line AC, landing at F.

The segment AB is the hypotenuse of right triangle AFB (unless F = A), so AB ≥ AF. In the same way, BC ≥ FC. Therefore

AB + BC ≥ AF + FC

Now look along the line. If F is between A and C, then AF + FC = AC exactly. If F is outside the segment, then AF + FC is larger than AC. In every case AF + FC ≥ AC, so AB + BC ≥ AC.

Equality needs both steps to be exact. AB = AF and BC = FC force B to coincide with F, which puts B on the line. AF + FC = AC forces F onto the segment. So B is on segment AC.

Euclid's version

Euclid proved the same fact without the Pythagorean theorem, as Proposition 20 of Book I of the Elements. Take triangle ABC and extend side BA past A to a point D with AD = AC.

  1. Triangle ADC is isosceles, so ∠ADC = ∠ACD.
  2. Angle BCD contains angle ACD and more, so ∠BCD > ∠ADC.
  3. In triangle BCD, the larger angle faces the longer side, so BD > BC.
  4. But BD = BA + AD = BA + AC, so BA + AC > BC.

According to the later commentator Proclus, some Epicurean critics mocked the theorem as obvious even to a donkey, which walks straight to its food. The reply was that seeing something and deriving it from stated principles are different achievements.

Which lengths make a triangle?

Given three positive lengths, test only the longest against the sum of the other two.

Lengths Comparison Result
5, 7, 9 9 < 12 A triangle
3, 4, 7 7 = 7 Flattened into a segment
3, 4, 8 8 > 7 No figure closes up

If two sides are 5 and 9, the third side x must satisfy x < 14 and 9 < 5 + x. So 4 < x < 14. The range runs from the difference of the known sides to their sum. More practice is in which three lengths form a triangle.

You can see this with a compass. Draw a base of length 9, then circles of radius 3 and 4 about its ends. If you swap in a longest length of 8 with sides 3 and 4, the circles never reach each other.

Longest side against the other two
Shorter Longest is less than the sum A real triangle forms Equal Longest equals the sum The three points fall on one line Longer Longest exceeds the sum The two short sides cannot meet Shorter Longest is less than the sum A real triangle forms Equal Longest equals the sum The three points fall on one line Longer Longest exceeds the sum The two short sides cannot meet

The reverse form

Rearranging the inequality gives a lower bound:

|AB − BC| ≤ AC.

The distance between two places is at least the difference of their distances from a third. If a tower is 10 km from you and 4 km from a friend, you and your friend are at least 6 km apart and at most 14 km apart.

Paths with many corners

Take a route A → B → C → D. Apply the inequality twice:

AD ≤ AC + CD
AC ≤ AB + BC
AD ≤ AB + BC + CD

Repeating this shows that no chain of segments is shorter than the straight segment between its ends. The length of a smooth curve is defined as the limit of lengths of such chains, taken with finer and finer corners. So no curve from A to D is shorter than segment AD either.

Using it to prove other inequalities

A point inside a triangle. Let P be inside triangle ABC. Then PB + PC < AB + AC. To see this, extend BP until it meets side AC at D.

AB + AD > BD = BP + PD
PD + DC > PC
add:  AB + AC + PD > BP + PD + PC
      AB + AC > BP + PC

Total distance to the corners. Adding the three versions of that result shows PA + PB + PC is less than the perimeter. Applying the triangle inequality to triangles PAB, PBC and PCA and adding shows PA + PB + PC is more than half the perimeter.

A meeting place for four. A, B, C and D are the corners of a convex quadrilateral, in order. Which point P has the smallest total PA + PB + PC + PD? We have PA + PC ≥ AC and PB + PD ≥ BD. Both become equalities at the crossing of the diagonals, so that crossing is the best point.

The pattern is worth keeping. Find a lower bound that holds for every point, then find one point that reaches it.

A bound on a median

A median joins a vertex to the midpoint of the opposite side. How long can the median from A be?

Let M be the midpoint of BC. Extend segment AM beyond M to a point D with MD = AM. The segments AD and BC bisect each other, so ABDC is a parallelogram and BD = AC. Now apply the inequality to triangle ABD:

AD < AB + BD
2 · AM < AB + AC
AM < (AB + AC) / 2

With AB = 5 and AC = 9, the median is less than 7. Using the same triangle the other way, AD > BD − AB = 4, so the median is more than 2. The extra segment turned a question about a line inside the triangle into a question about three sides of a new triangle.

Counting integer triangles

How many different triangles have whole-number sides and perimeter 12? The inequality says the longest side must be less than the other two combined, which means less than half the perimeter, so at most 5.

  • Longest side 5: the other two add to 7, giving 5, 5, 2 and 5, 4, 3.
  • Longest side 4: the other two add to 8, giving 4, 4, 4.

A longest side below 4 cannot reach a total of 12. There are exactly three triangles. Without the inequality you might also list 6, 4, 2, which collapses into a segment.

A common slip in problems

Suppose two sides of an isosceles triangle measure 4 and 9. What is the perimeter? The third side equals one of these. The choice 4 gives sides 4, 4, 9, and 4 + 4 < 9, so it is impossible. The third side must be 9, and the perimeter is 22.

Whenever a problem leaves a length open, run the test on every candidate before reporting it.

Shortest routes with a condition

Many least-distance puzzles reduce to straightening a bent path. When a route must touch a wall, you can reflect one endpoint and then apply the inequality. When it must cross the surface of a box, you can unfold the faces flat, as in the spider and the fly puzzle.

In each case the difficulty is rarely the inequality itself. It lies in finding a transformation that keeps lengths unchanged and turns the allowed paths into paths between two fixed points.

Distance in other settings

On a sphere, if you must stay on the surface, the shortest routes are arcs of great circles, and surface distance still obeys the triangle inequality.

In a city with a square street grid, distance by streets is the horizontal difference plus the vertical difference. This taxicab distance also satisfies the inequality, but equality happens far more often, because many different routes tie for shortest.

Mathematicians make the rule an axiom. A metric is any distance function that is never negative, is zero only from a point to itself, is the same in both directions and obeys the triangle inequality. See how nearest depends on the ruler.

Squared distance fails the test. For the points 0, 1 and 2 on a number line, the squared distance from 0 to 2 is 4, while the two steps add to only 1 + 1 = 2. A "distance" like that would make detours cheaper than direct travel.

Where it helps in practice

The inequality is a quick sanity check on measurements. If a plan shows a triangular garden bed with sides of 2 m, 3 m and 6 m, at least one figure is wrong before any digging starts.

It also saves computing. A program searching for the nearest of many shops can skip some distance calculations. If you are 1 km from a depot and the depot is 9 km from a shop, the shop is at least 8 km from you. Once you have found anything closer than 8 km, that shop needs no further attention.

Estimates work the same way. Without measuring the direct distance, two known legs of 700 m and 200 m tell you it lies between 500 m and 900 m. The direction of the turn decides where in that range.

Common questions

Can a side ever equal the sum of the other two?

Only when the three points are collinear, and then most definitions no longer call the figure a triangle. It is often called a degenerate triangle.

Do I need to check all three inequalities?

No. If the longest side passes, the other two comparisons are automatically true, since each has the longest side on the larger side of the comparison.

Is it still true in three dimensions?

Yes. Any three points lie in a plane, so the plane proof applies without change.

Written for 4Geometry with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 39 articles in Points, Lines and Angles →

Latest news on this topic