Pythagorean theorem and triangle relationships