Dijkstra extends Pythagoras
by John from John D. Cook on (#6151M)
Suppose a triangle has sides a, b, and c. Label the angles opposite these three sides , , and respectively.
Edsger Dijkstra published (EWD975) a note proving the following extension of the Pythagorean theorem:
sgn( + - ) = sgn(a^2 + b^2 - c^2).
Here the sgn function is -1, 0, or 1 depending on whether its input is negative, zero, or positive.
To see that this really is an extension of the Pythagorean theorem, if is a right angle, then + = and so the sgn on the left hand side evaluates to 0. This forces the right hand side to 0, which says a^2 + b^2 = c^2.
As Dijkstra points out, his is a theorem about triangles, not simply a theorem about right triangles.
More Dijkstra postsThe post Dijkstra extends Pythagoras first appeared on John D. Cook.