In mathematics, the Pythagorean theorem, or Pythagoras' theorem, is a fundamental relation in Euclidean geometry among the three sides of a right triangle and it states that the area of the square whose side is the hypotenuse (the side opposite the right angle) is equal to the sum of the areas of the squares on the other two sides. The theorem is named for the Greek philosopher Pythagoras (Πυθαγόρας; umbes 580 eKr – 500 eKr).
$$a^{2}+b^{2}=c^{2}\Leftrightarrow c= \sqrt{a^{2}+b^{2}}$$
A generalization of this theorem is the https://www.mathsqrt.com/en/law-of-cosines">law of cosines, which allows the computation of the length of any side of any triangle, given the lengths of the other two sides and the angle between them. If the angle between the other sides is a right angle, the law of cosines reduces to the Pythagorean equation.
It states that in a right triangle, the sum of the squares of the legs equals the square of the hypotenuse.
You can use it only for right triangles, where one angle is 90 degrees.
Take the square root of the sum of the squares of the two legs.