Pythagorean Theorem and Algebraic Equations