You can download this code by clicking the button below.
This code is now available for download.
Calculate the length of the hypotenuse of a right-angled triangle.
Technology Stack : None
Code Type : Mathematical calculation function
Code Difficulty : Intermediate
def calculate_hypotenuse(a, b):
"""Calculate the length of the hypotenuse of a right-angled triangle.
Args:
a (float): Length of the first leg of the triangle.
b (float): Length of the second leg of the triangle.
Returns:
float: Length of the hypotenuse.
"""
return (a**2 + b**2)**0.5