No — on a sphere, a2 + b2 = c2 is not exactly true. For a right triangle drawn on a sphere of radius R, with sides measured along great circles, the exact rule is cos(c/R) = cos(a/R)cos(b/R). The hypotenuse comes out shorter than the flat formula predicts, but for triangles much smaller than the sphere the difference is negligible.
On the hyperbolic plane, the other classical non-Euclidean geometry, the cosines become hyperbolic cosines and the hypotenuse comes out longer. This page derives the spherical version, shows why both versions collapse to the ordinary Pythagorean theorem for small triangles, and explains why the flat theorem depends on Euclid's parallel postulate.
Why the flat theorem needs a flat world
Euclid built geometry on five postulates. The fifth, the parallel postulate, is equivalent to the familiar statement that through a point not on a line there is exactly one parallel to that line. For two thousand years mathematicians tried to prove it from the other four and failed. In the 19th century Nikolai Lobachevsky (who published in 1829) and János Bolyai (around 1832) showed why: a perfectly consistent geometry exists in which the postulate is false. Gauss had reached the same conclusion privately but never published it.
The Pythagorean theorem, which is far older than Euclid (see its history), is tied to that postulate. Every proof of it uses the parallel postulate somewhere, often invisibly — Euclid's proof needs squares, and a four-sided figure with four right angles exists only if the parallel postulate holds. In fact, on top of Euclid's other axioms, the Pythagorean theorem and the parallel postulate are logically equivalent: each implies the other. So once you leave the flat plane, the theorem must change.
NoteOn a sphere you cannot even draw the three squares. Walk 100 km north, turn right, 100 km east, turn right, 100 km south, turn right, 100 km west — you do not end where you started. Quadrilaterals with four right angles do not exist on curved surfaces, which is why the curved versions of the theorem are stated with lengths, not areas. (On flat paper, by contrast, the squares can even be swapped for semicircles or other shapes.)
Right triangles on a sphere
On a sphere the role of straight lines is played by great circles — circles whose center is the center of the sphere, such as the equator or any line of longitude. The shortest path between two points on the surface runs along a great circle, which is why long-haul flights follow curved-looking routes on flat maps. A spherical triangle has three great-circle arcs as sides, and its side lengths are measured along the surface.
Spherical triangles behave strangely. Their angles always add up to more than 180°, and the excess grows with the triangle's area. The extreme example is easy to picture on Earth.
Start at the North Pole, walk south along the prime meridian to the equator (a point in the Gulf of Guinea), turn left and walk east along the equator to longitude 90° E (in the Indian Ocean, west of Sumatra), then turn left again and walk back north to the pole. Each leg is a quarter of a great circle, and every turn is exactly 90°.
Take Earth as a sphere of mean radius R ≈ 6,371 km. Each side is πR over 2 ≈ 10,008 km. Treat NA and AB as legs of a right triangle and the flat formula predicts NB = √2 × 10,008 ≈ 14,153 km. The real distance is 10,008 km. Here the flat theorem is not slightly off; it is off by more than 4,000 km.
This triangle also illustrates Girard's theorem: the area of a spherical triangle equals R2 times its angle excess (angle sum minus 180°, in radians). Here the excess is 90°, or π over 2, so the area is π over 2R2 — exactly one-eighth of Earth's surface, about 63.8 million km².
The spherical Pythagorean theorem
For a right triangle on a sphere of radius R, with legs a and b and hypotenuse c measured along the surface:
cosc over R = cosa over R · cosb over RThe quantities a/R, b/R and c/R are the angles (in radians) that each side subtends at the center of the sphere. Check it on the three-right-angle triangle: cosπ over 2 · cosπ over 2 = 0 = cosπ over 2, so c = πR over 2, as it should be.
A short proof with vectors
Put the sphere's center at the origin. For any two points P and Q on the sphere, the dot product of their position vectors is P · Q = R2cosθ, where θ is the angle between them — and the surface distance from P to Q is Rθ.
- Place the right angle. Put the right-angle vertex at C = (R, 0, 0). Run one leg along the great circle in the xy-plane and the other along the great circle in the xz-plane. Their directions at C are the y- and z-axes, which are perpendicular, so the angle at C is 90°.
- Write the other two corners. Moving a distance b along the first circle and a along the second gives A = R(cosb over R, sinb over R, 0) and B = R(cosa over R, 0, sina over R). Both really lie on the sphere, because cos2θ + sin2θ = 1 (the Pythagorean identity).
- Take the dot product. A · B = R2cosa over Rcosb over R + 0 + 0. But also A · B = R2cosc over R, because c is the distance from A to B. Setting the two equal gives the theorem.
The formula is the special case C = 90° of the spherical law of cosines, cosc over R = cosa over Rcosb over R + sina over Rsinb over RcosC, just as the flat theorem is the special case of the law of cosines.
Example 1: a right triangle with 1,000 km legs
On Earth (R = 6,371 km), two legs of 1,000 km meet at a right angle. Find the hypotenuse.
cosc over R= cos2(1000 over 6371) ≈ 0.975565c over R≈ arccos(0.975565) ≈ 0.221519c≈ 6371 × 0.221519 ≈ 1,411.30 kmThe flat formula gives 1000√2 ≈ 1,414.21 km, about 2.92 km too long — an error of about 0.2%. The triangle's angles add up to about 180.71°.
Example 2: legs of 5,000 km
Same question with legs of 5,000 km each (roughly the scale of a continent).
c = 6371 arccos(cos25000 over 6371) ≈ 6,667 kmThe flat answer, about 7,071 km, is now roughly 404 km too long, and the angles add up to about 199.4°.
Small triangles: how a² + b² = c² comes back
Surveyors use the ordinary theorem on a round planet without any trouble, and a series expansion shows why. Expand the cosines in their Taylor series, cosx = 1 − x2 over 2 + x4 over 24 − ⋯, and substitute into the spherical formula:
1 − c2 over 2R2 + c4 over 24R4 − ⋯ = (1 − a2 over 2R2 + a4 over 24R4 − ⋯)(1 − b2 over 2R2 + b4 over 24R4 − ⋯)The 1s cancel. Multiply everything by −2R2 and keep the largest terms. To leading order the equation says c2 = a2 + b2 — the flat theorem. Keeping the next terms as well (and using c4 ≈ (a2 + b2)2 inside them) gives the first correction:
c2 ≈ a2 + b2 − a2b2 over 3R2The correction is tiny when the legs are small compared with R, because it is divided by R2. As R → ∞ — a sphere so large it is effectively flat — it disappears completely.
Plug in Earth-sized numbers to see how small "small" is. For an isosceles right triangle with legs L, the correction term says the flat formula overestimates the hypotenuse by about L3 over 6√2 R2. The table uses the exact spherical formula:
| Legs (each) | Flat hypotenuse | Flat formula is too long by |
|---|---|---|
| 100 m (a sports field) | 141.42 m | about 0.000000003 m (3 nanometers) |
| 10 km (a town) | 14.142 km | about 2.9 mm |
| 1,000 km (a country) | 1,414.2 km | about 2.9 km |
| 5,000 km (a continent) | 7,071.1 km | about 404 km |
That is why builders, surveyors and video-game engines use the flat theorem without a second thought, while airline navigators and GPS software switch to spherical (or ellipsoidal) formulas; see the Pythagorean theorem in navigation and the flat-map distance formula.
The hyperbolic Pythagorean theorem
Hyperbolic geometry is the geometry of Lobachevsky and Bolyai: through a point off a line there are infinitely many parallels, triangles have angle sums less than 180°, and space "spreads out" faster than a plane, like the frilly edge of a lettuce leaf or a saddle that is saddle-shaped everywhere. Its curvature is negative, −1/R2. For a right triangle with legs a, b and hypotenuse c:
coshc over R = cosha over R · coshb over RHere coshx = 1 over 2(ex + e−x) is the hyperbolic cosine, whose series is 1 + x2 over 2 + x4 over 24 + ⋯ — the cosine series with every sign made positive. The same expansion as before gives
c2 ≈ a2 + b2 + a2b2 over 3R2so hyperbolic hypotenuses are slightly longer than flat ones, and again the ordinary theorem returns for small triangles. The vector proof carries over too: in the "hyperboloid model" of the hyperbolic plane the dot product is replaced by x1y1 + x2y2 − x3y3, and the same three steps turn every cos into cosh.
Example 3: one triangle, three geometries
Take R = 1 and legs a = 1, b = 0.8.
plane: c= √1 + 0.64 ≈ 1.281sphere: c= arccos(cos1 · cos0.8) ≈ 1.185hyperbolic: c= arccosh(cosh1 · cosh0.8) ≈ 1.353The spherical hypotenuse is shorter and the hyperbolic one longer than the Euclidean value, exactly as the correction terms ∓a2b2 over 3R2 predict.
Pythagoras survives in the small: the line element
The small-triangle limit is not a coincidence; it is built into how modern geometry measures curved spaces. In Riemannian geometry (and in Einstein's general relativity) distance is defined by a line element that says how long a tiny step is. In a flat plane with ordinary coordinates it is the Pythagorean theorem for an infinitesimal right triangle:
ds2 = dx2 + dy2On a sphere, using latitude φ and longitude λ, it becomes ds2 = R2 dφ2 + R2cos2φ dλ2 — still a sum of squares of two perpendicular steps, but with weights that change from place to place. Every curved surface looks flat if you zoom in far enough, and at that scale the Pythagorean theorem is exactly right. Curvature is what you see when the small right triangles are stitched together into large ones. For how this plays out in physics, see the Pythagorean theorem in physics.
Frequently asked questions
Does the Pythagorean theorem work on a sphere?
Not exactly. On a sphere of radius R a right triangle satisfies cos(c/R) = cos(a/R)cos(b/R), and the hypotenuse is always shorter than √a2 + b2. For triangles that are small compared with the sphere the difference is so small that a2 + b2 = c2 is an excellent approximation.
Can I use a² + b² = c² for distances on Earth?
For anything up to a few kilometers, yes: the error for a 10 km triangle is about 3 millimeters. For distances between cities, the curvature matters and navigators use spherical formulas such as the haversine formula. Over continental distances the flat formula can be off by hundreds of kilometers.
Can a triangle have three right angles?
Yes, on a sphere. Join the North Pole to two points on the equator that are 90° of longitude apart; all three angles are 90° and all three sides are a quarter of a great circle. In flat geometry it is impossible, because the angles of a triangle must add up to exactly 180°.
Is the Pythagorean theorem equivalent to the parallel postulate?
Yes, in the sense that, assuming Euclid's other axioms, each implies the other. That is why the theorem fails in spherical and hyperbolic geometry, where the parallel postulate fails (spherical geometry also changes some of Euclid's other axioms).
What is the hyperbolic Pythagorean theorem?
For a right triangle in the hyperbolic plane with curvature −1/R2, cosh(c/R) = cosh(a/R)cosh(b/R). The hypotenuse is longer than in flat geometry, and the relation reduces to c2 = a2 + b2 for small triangles.
Why do the curved versions use cosines instead of squares?
Because on a sphere distance corresponds to an angle at the center, and the natural way to combine angles is through the dot product, which produces cosines. Squares reappear in the Taylor expansion cosx ≈ 1 − x2/2, which is how a2 + b2 = c2 emerges for small triangles.
Sources and further reading
- Marvin Jay Greenberg, Euclidean and Non-Euclidean Geometries: Development and History, 4th ed., W. H. Freeman, 2008.
- Glen Van Brummelen, Heavenly Mathematics: The Forgotten Art of Spherical Trigonometry, Princeton University Press, 2013.
- Wolfram MathWorld: Spherical Trigonometry.
- MacTutor History of Mathematics: Non-Euclidean geometry.
- Wikipedia: Parallel postulate (list of statements equivalent to it, including the Pythagorean theorem).
Keep exploring
- LearnThe Pythagorean Theorem in n DimensionsThe Pythagorean theorem in n dimensions: the Euclidean norm, orthogonal vectors and the dot product, inner-product spaces, Parseval's identity and data science.
- LearnThe Law of CosinesThe law of cosines c² = a² + b² − 2ab·cos C explained: how it extends the Pythagorean theorem, a proof by dropping an altitude, and SAS and SSS examples.
- Real-life usesThe Pythagorean Theorem in Navigation and GPSHow the Pythagorean theorem is used in navigation: map distances, ship and plane displacement, wind triangles, GPS trilateration and the limits of flat maps.
- LearnThe Pythagorean IdentityThe Pythagorean identity sin²θ + cos²θ = 1 derived from the unit circle, the related tan/sec and cot/csc identities, and how to find cos from sin by quadrant.
- HistoryHistory of the Pythagorean TheoremThe history of the Pythagorean theorem from Babylon (1800 BCE) to a 2023 proof: who discovered it, who proved it first, and why it bears Pythagoras' name.
- LearnThe Pythagorean Theorem with Semicircles and Other ShapesEuclid VI.31 extends the Pythagorean theorem from squares to semicircles, equilateral triangles and any similar shapes. See why it works, with examples.