What is the length of Hypotenusof a right-angled triangle if Theperpendicular sides are 5 cm and12 cm respectively?

Find the length of the hypotenuse of a right angled triangle if remaining sides are 9 cm and 12 cm.

In a right angled triangle,
According to Pythagoras theorem.

\[\left( \text{Hypotenuse} \right)^2 = \left( \text{Base} \right)^2 + \left( \text{Height} \right)^2 \]

\[ = \left( 9 \right)^2 + \left( 12 \right)^2 \]

\[ = 81 + 144\]

\[ = 225\]

\[ \therefore \text{Hypotenuse} = 15 cm\]

Hence, the length of the hypotenuse is 15 cm.

Concept: Apollonius Theorem

  Is there an error in this question or solution?

13cm. Using Pythagoras theorem a^2 +b^2 =c^2 we substitute our two known lengths into the equation to get 5^2 + 12^2=c^2.
So now we have c^2= 25+144. So c^2 =169. So c=√169 = 13. Don't forget the units!!! So answer is 13cm

Last update on August 19 2022 21:50:49 (UTC/GMT +8 hours)

Write a Python program to calculate the hypotenuse of a right angled triangle.

From Wikipedia,
A right triangle or right-angled triangle, or more formally an orthogonal triangle, is a triangle in which one angle is a right angle. The relation between the sides and angles of a right triangle is the basis for trigonometry. The side opposite the right angle is called the hypotenuse. If the lengths of all three sides of a right triangle are integers, the triangle is said to be a Pythagorean triangle and its side lengths are collectively known as a Pythagorean triple.

Pictorial Presentation:


Sample Solution-1:

Python Code :

from math import sqrt print("Input lengths of shorter triangle sides:") a = float(input("a: ")) b = float(input("b: ")) c = sqrt(a**2 + b**2) print("The length of the hypotenuse is:", c )

Sample Output:

Input lengths of shorter triangle sides: a: 3 b: 4 The length of the hypotenuse is: 5.0

Visualize Python code execution:

The following tool visualize what the computer is doing step-by-step as it executes the said program:


Sample Solution-2:

Python Code:

def test(x, y): h = (x**2 + y**2)**0.5 return h print(test(3,4)) print(test(3.5,4.4))

Sample Output:

5.0 5.622277118748239

Flowchart:


Visualize Python code execution:

The following tool visualize what the computer is doing step-by-step as it executes the said program:


Python Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a Python program to convert height (in feet and inches) to centimeters.
Next: Write a Python program to convert the distance (in feet) to inches, yards, and miles.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Share this Tutorial / Exercise on : Facebook and Twitter

You cannot use a number at the beginning of the name of a variable

four_letters = �abcd� # this works 4_letters = �abcd� # this doesn�t work

Ref: //bit.ly/3A1PCO4


  • Exercises: Weekly Top 16 Most Popular Topics
  • SQL Exercises, Practice, Solution - JOINS
  • SQL Exercises, Practice, Solution - SUBQUERIES
  • JavaScript basic - Exercises, Practice, Solution
  • Java Array: Exercises, Practice, Solution
  • C Programming Exercises, Practice, Solution : Conditional Statement
  • HR Database - SORT FILTER: Exercises, Practice, Solution
  • C Programming Exercises, Practice, Solution : String
  • Python Data Types: Dictionary - Exercises, Practice, Solution
  • Python Programming Puzzles - Exercises, Practice, Solution
  • C++ Array: Exercises, Practice, Solution
  • JavaScript conditional statements and loops - Exercises, Practice, Solution
  • C# Sharp Basic Algorithm: Exercises, Practice, Solution
  • Python Lambda - Exercises, Practice, Solution
  • Python Pandas DataFrame: Exercises, Practice, Solution
  • Conversion Tools
  • JavaScript: HTML Form Validation

Última postagem

Tag