Pythagorean Theorem#

pyquations.geometry.pythagorean_theorem.pythagorean_theorem(a: float, b: float) float[source]

This function calculates the hypotenuse of a right triangle using the Pythagorean theorem: c^2 = a^2 + b^2.

Parameters:
  • a (float) – Length of one leg of the triangle. Must be non-negative.

  • b (float) – Length of the other leg of the triangle. Must be non-negative.

Returns:

The length of the hypotenuse.

Return type:

float

Raises:

ValueError – If either ‘a’ or ‘b’ is negative.