The converse of the Pythagorean theorem