Why was Pythagorean theorem invented?

Pythagorean theorem was invented by the ancient Greek mathematician Pythagoras in order to calculate the length of the sides of a right triangle. It states that the square of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides. This theorem is used in many areas of mathematics, including geometry, trigonometry, and algebra.