This JavaScript app helps you calculate the side of a right-angled triangle using the Pythagorean theorem. The Pythagorean theorem states that in a right-angled triangle, the square of the length of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the lengths of the other two sides.
You can try out the live app https://pradeepkumarverma1.github.io/pythagoras/
To get started with the Right Angled Triangle Calculator, simply download or clone the repository to your local machine and open the index.html
file in your web browser.
git clone https://github.com/pradeepkumarverma1/pythagoras.git
To calculate the length of a side of a right-angled triangle, provide values for two of the three sides:
- If you know the length of the base and height, the app will calculate the length of the hypotenuse.
- If you know the length of the base and hypotenuse, the app will calculate the length of the height.
- If you know the length of the height and hypotenuse, the app will calculate the length of the base.
The formula used by the app to calculate the length of the missing side is based on the Pythagorean theorem:
- If you know the base (b) and height (h), the hypotenuse (c) can be calculated as
c = sqrt(b^2 + h^2)
. - If you know the base (b) and hypotenuse (c), the height (h) can be calculated as
h = sqrt(c^2 - b^2)
. - If you know the height (h) and hypotenuse (c), the base (b) can be calculated as
b = sqrt(c^2 - h^2)
.
Feel free to contribute to the project or report any issues on GitHub