Generalizations of the Pythagorean theorem