Given the P, B and H are the perpendicular, base and hypotenuse respectively of a right angled triangle. The task is to find the area of the incircle of radius r as shown below:
Input: P = 3, B = 4, H = 5
Input: P = 5, B = 12, H = 13
Approach: Formula for calculating the inradius of a right angled triangle can be given as r = ( P + B – H ) / 2.
And we know that the area of a circle is PI * r2 where PI = 22 / 7 and r is the radius of the circle.
Hence the area of the incircle will be PI * ((P + B – H) / 2)2.
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to calculate the Area and Perimeter of Incircle of an Equilateral Triangle
- Find all sides of a right angled triangle from given hypotenuse and area | Set 1
- Number of possible pairs of Hypotenuse and Area to form right angled triangle
- Area of Circumcircle of a Right Angled Triangle
- Find the height of a right-angled triangle whose area is X times its base
- Program to find the Radius of the incircle of the triangle
- Check whether right angled triangle is valid or not for large sides
- Find the dimensions of Right angled triangle
- Check if a right-angled triangle can be formed by the given coordinates
- Find the hypotenuse of a right angled triangle with given two sides
- Check if a right-angled triangle can be formed by moving any one of the coordinates
- Count of Right-Angled Triangle formed from given N points whose base or perpendicular are parallel to X or Y axis
- Check if a right-angled triangle can be formed by the given side lengths
- Dividing the rectangle into n right-angled triangles
- Count right angled triangles in a matrix having two of its sides parallel to sides of the matrix
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Check if right triangle possible from given area and hypotenuse
- Area of a largest square fit in a right angle triangle
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- Program to print a Hollow Triangle inside a Triangle
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.