Algorithm Implementation/Mathematics/Pythagorean theorem

In mathematics, the Pythagorean theorem or Pythagoras' theorem  is a relation in Euclidean geometry among the three sides of a right triangle (right-angled triangle). In terms of areas, it states: In any right triangle, 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 whose sides are the two legs (the two sides that meet at a right angle). The theorem can be written as an equation relating the lengths of the sides a, b and c, often called the Pythagorean equation:
 * $$a^2 + b^2 = c^2\!\,$$

where c represents the length of the hypotenuse, and a and b represent the lengths of the other two sides.

Note: for most languages, a built-in  function performs the same calculation. This is for education only.