Triangle Inequality Theorem Calculator
Results
Formulas Used in Triangle Inequality Theorem Calculator
In-Depth Tutorial: Triangle Inequality Theorem Calculator
The Triangle Inequality Theorem is one of the most fundamental statements in plane geometry: the sum of any two sides of a triangle must be strictly greater than the third side. Equivalently, no side can be longer than (or equal to) the sum of the other two. This tutorial proves the theorem, explains why "strictly greater" matters, walks through how to test any candidate set of three lengths, and shows how the same inequality generalizes to vector norms and metric spaces.
The theorem stated three ways
For any triangle with sides a, b, c, all three of the following must hold:
a + b > c
a + c > b
b + c > a
Equivalent compact statement: the longest side must be less than the sum of the other two.
The strict inequality matters. If a + b = c exactly, the "triangle" collapses to a single line segment — the three points are collinear. This degenerate case is not a triangle.
Why the theorem is true — geometric intuition
Think of building a triangle by laying three sticks end-to-end and trying to close them into a loop. Say the sticks have lengths a = 3, b = 4, c = 10.
Lay c flat on the ground. From one end, hinge stick a upward. From the other end of c, hinge stick b upward. Now try to make the free ends of a and b meet.
The longest a can stretch from its base is 3 units up (if it goes straight up). The longest b can stretch from its base is 4 units up. The two bases are 10 units apart. Even if both sticks go straight up, their free ends are 10 units apart horizontally — they cannot meet. Conclusion: no triangle exists with sides 3, 4, 10.
If we replace c = 10 with c = 6, the bases are now 6 units apart, and stick a (length 3) can reach across at most 3 units. So a + b = 7 must exceed c = 6 — and 7 > 6, so it works. The two free ends can meet at some point above the line, forming the triangle.
Formal proof — using the shortest-path principle
The shortest path between two points is the straight line connecting them. Any other path is strictly longer.
Suppose a triangle has vertices A, B, C with the side opposite each labeled a, b, c respectively. The path from A to B going directly (length c) is shorter than the path from A to C to B (length b + a). Therefore c < b + a, i.e., a + b > c.
The same argument applied to the other two pairs of vertices gives a + c > b and b + c > a.
Testing three numbers
To check whether (a, b, c) can form a triangle, you only need to test the longest side. If the longest side is less than the sum of the other two, the triangle is valid. If it equals or exceeds that sum, no triangle.
Example tests:
- (3, 4, 5): longest = 5. Other two sum to 7. 5 < 7 ✓ — valid triangle (the famous 3-4-5 right triangle).
- (5, 7, 12): longest = 12. Other two sum to 12. 12 ≥ 12 ✗ — degenerate (a straight line).
- (2, 3, 6): longest = 6. Other two sum to 5. 6 > 5 ✗ — impossible.
- (1, 1, 1): longest = 1. Other two sum to 2. 1 < 2 ✓ — valid (equilateral triangle).
Range of the third side, given two
Knowing two sides constrains the third. If a and b are given, the third side c must satisfy:
|a − b| < c < a + b
The upper bound is the triangle inequality. The lower bound is the same inequality applied to a different pairing: if c were less than or equal to |a − b|, the longer of a, b would exceed the sum c + (shorter of a, b), violating the inequality.
Example: a = 4, b = 7. Then 3 < c < 11. The third side can be any real number strictly between 3 and 11.
Why "strict inequality" matters
The boundary case a + b = c produces a "degenerate triangle" — three collinear points. Some textbooks include degenerate triangles in their definition of "triangle" (so the inequality becomes ≤). The mainstream convention requires strict inequality, and most calculators (including ours) treat the equality case as invalid.
The same theorem in vector form
The Triangle Inequality generalizes to vectors. For any two vectors u and v in any number of dimensions:
|u + v| ≤ |u| + |v|
(with equality only when u and v point in exactly the same direction, the degenerate case). This is the triangle inequality for the Euclidean norm. The same shape generalizes further to inner product spaces, normed linear spaces, and metric spaces — the inequality is one of the three defining axioms of a metric d: d(x, z) ≤ d(x, y) + d(y, z).
So the geometric triangle inequality is not just a curiosity of plane geometry — it is the defining property of "distance" in mathematics.
Common mistakes
- Only checking one of the three inequalities. All three must hold. (3, 4, 5) satisfies a + b > c but it would still need a + c > b and b + c > a — fortunately all three do. For (3, 4, 8), a + b > c fails: 3 + 4 = 7 < 8, so it's invalid. You only need to find ONE failure to rule out the triangle, but the calculator tests all three for clarity.
- Using ≥ instead of >. Strict inequality. A degenerate "triangle" with all three points collinear is not a triangle.
- Confusing "valid triangle" with "valid right triangle". Triangle inequality determines whether ANY triangle exists. To check whether the triangle is right, separately verify a² + b² = c² (Pythagorean test, where c is longest).
- Forgetting that all sides must be positive. A side length of 0 or negative cannot form a triangle regardless of what the others are.
Frequently Asked Questions – Triangle Inequality Theorem Calculator
The sum of any two sides of a triangle must be strictly greater than the third: a + b > c, a + c > b, and b + c > a. All three conditions must hold.
If any of the three inequalities is not satisfied, the three sides cannot form a triangle. The calculator will clearly indicate which condition failed.
If a + b = c, the triangle degenerates into a straight line. All three inequalities must be strict (greater than, not equal to).
Yes — free and unlimited.
Euclid's Proposition I.20 — the theorem the Greeks called obvious
The triangle inequality appears as Proposition 20 of Book I of Euclid's Elements (~300 BCE). Euclid stated it as "In any triangle two sides taken together in any manner are greater than the remaining one." His proof used the exterior-angle theorem plus the "greater angle opposite greater side" rule — a chain of two earlier propositions.
The historically interesting part: the ancient Greek philosophical school of the Epicureans mocked Euclid's inclusion of this theorem as unnecessary. They pointed out that even a donkey wandering across a field, faced with the choice between walking directly from point A to point B versus taking a detour through point C, would take the direct path. The donkey, apparently, understood the triangle inequality without proof. Why should mathematicians spend a page proving something obvious to livestock?
Proclus, a 5th-century commentator on Euclid, defended the proof by pointing out that "obvious" isn't the same as "proven." A donkey's behavior isn't a mathematical proof of a geometric relationship — it's an observation about animal navigation. The formal proof establishes that the triangle inequality follows from the other Euclidean axioms, which turns the observation into a theorem. This "prove even the obvious" attitude became the template for rigorous mathematics, from Euclid through modern proof assistants like Lean and Coq.
The Epicurean joke has a dark punchline: 2,300 years later, mathematicians discovered that the triangle inequality fails in some geometries — notably in the "Chebyshev" and "taxicab" distances used in computer science, and in indefinite metrics like the Lorentzian metric used in relativity. So the theorem isn't obvious in the abstract; it's only obvious in specific geometric settings that happen to include the world donkeys navigate. Euclid was right to prove it, and mathematically-inclined donkeys should hedge their assumptions about which metric they're operating in.
The rule that makes distance meaningful
Beyond geometry, the triangle inequality plays a foundational role in modern mathematics as one of three axioms defining a metric space. A "distance function" d(x, y) in any context must satisfy:
- Positivity:
d(x, y) ≥ 0, with equality iffx = y. (A point has zero distance from itself; distinct points have positive distance.) - Symmetry:
d(x, y) = d(y, x). (Distance doesn't depend on direction.) - Triangle inequality:
d(x, z) ≤ d(x, y) + d(y, z). (Going directly from x to z is at most as long as going via y.)
Anything that satisfies all three axioms is a legitimate "distance" for mathematical purposes. Ordinary Euclidean distance obeys them; so do less-obvious functions like the "edit distance" between two strings (Levenshtein distance), the "Hausdorff distance" between two sets, and the "Fréchet distance" between two curves. Every one of these earns its name because it satisfies the triangle inequality.
The reason this matters: many algorithms and theorems that hold for Euclidean distance actually hold for any metric — they only depend on the three axioms, not on the specific formula. Search algorithms like k-nearest-neighbor, clustering algorithms like DBSCAN, and the notion of "convergence" in analysis are all "metric-space-generic" and work with any triangle-inequality-satisfying distance function. When a data scientist chooses a "distance metric" for a machine-learning problem, they're choosing which triangle-inequality-satisfying function best captures the notion of similarity for their data.
The elementary triangle inequality this calculator checks is the finite-dimensional special case of a principle that underlies most of modern analysis, topology, and functional analysis. The theorem starts as a plane-geometry curiosity and turns out to be a load-bearing beam of higher mathematics.
Deeper questions about triangle inequalities
What's the "reverse triangle inequality"?
For any three points, in addition to d(x, z) ≤ d(x, y) + d(y, z), we also have |d(x, y) − d(y, z)| ≤ d(x, z). This "reverse" or "second" triangle inequality bounds the difference of two distances from below by the third distance. Both forms follow from the basic triangle inequality by algebraic manipulation. The reverse form is useful for bounding differences: if you know d(A, B) = 100 and d(B, C) = 30, then d(A, C) must be between |100 − 30| = 70 and 100 + 30 = 130. The two forms together give both an upper and a lower bound on any unknown distance, using two known distances.
How does the triangle inequality show up in statistics?
Variance obeys a triangle-inequality-like relation: √Var(X + Y) ≤ √Var(X) + √Var(Y). The square root of variance is the standard deviation, so this says σ(X + Y) ≤ σ(X) + σ(Y). The inequality reflects the fact that adding two random variables can never produce a spread larger than the sum of their individual spreads — a foundational fact in finance for portfolio diversification (the standard deviation of a portfolio's return is bounded by the sum of the individual assets' standard deviations, and often much less because correlations reduce total spread). Signal processing uses the same inequality to bound the noise level in combined signals. The triangle inequality's role in statistics is why "standard deviation" behaves so predictably under addition of variables.
Why does "no side longer than the sum of the others" mean the same thing as "no side shorter than the difference"?
Because both are the triangle inequality applied to different orderings of the sides. If a + b > c (c can't be the longest), then rearranging gives c > |a − b|. Since this holds for any labeling of the sides, every side is greater than the difference of the other two. The upper bound c < a + b and the lower bound c > |a − b| together define the entire range of valid third-side lengths given two others. The two bounds are logically equivalent — each is derivable from the other via rearrangement — but stating both gives the intuition that any valid third side is "between the sum and the difference" of the given two.
Are there geometries where the triangle inequality is reversed?
Yes, though they don't describe physical space in the ordinary sense. In Minkowski spacetime — the geometric framework of special relativity — the "distance" between two events includes a subtraction of the time coordinate squared, which can make the "distance" imaginary or negative. The relativistic version of the triangle inequality is actually reversed for timelike separations: the direct path in spacetime takes more proper time than any indirect path. This is the mathematical content of the "twin paradox" — a twin who travels on a curved path through spacetime ages less than the twin who stays home on the "straight" path. The everyday triangle inequality holds only in space-like geometries where the metric is positive-definite; relativistic spacetime uses an indefinite metric where the sign of the inequality flips.