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² + b² – c²).
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² + b² = c².
As Dijkstra points out, his is a theorem about triangles, not simply a theorem about right triangles.