The pythagorean theorem and its converse