134k views
3 votes
If a right triangle has sides of length a, b and c and if c is the largest, then it is called the "hypotenuse" and its length is the square root of the sum of the squares of the lengths of the shorter sides (a and b). assume that variables a and b have been declared as doubles and that a and b contain the lengths of the shorter sides of a right triangle: write an expression for the length of the hypotenuse. submit

User AJ Friend
by
7.2k points

1 Answer

3 votes
Pythogoras Formula

{a}^(2) + {b}^(2) = {c}^(2)
If, otherwise, you want the sides of the shorter length, this fornula is applicable:

{a}^(2) = {c}^(2) - {b}^(2)
The shortest, known side is subtracted from the hypotenuse.
User NevenHuynh
by
8.0k points