Pythagorean theorem and triangles