Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Area of Incircle of a Right Angled Triangle in C Program?
To find the area of the incircle (inscribed circle) of a right angled triangle, we use the formula for the inradius and then calculate the area. The inradius r of a right angled triangle is given by r = (P + B − H) / 2, where P is the perpendicular, B is the base, and H is the hypotenuse.
The area of a circle is given by Area = ?*r2, where ? = 3.14159 and r is the radius of the circle.
Syntax
Area = ? * ((P + B - H) / 2)² where P = perpendicular, B = base, H = hypotenuse
Example
This program calculates the area of the incircle for a right triangle with sides 3, 4, and 5 −
#include <stdio.h>
#define PI 3.14159265
int main() {
float area, P = 3, B = 4, H = 5;
float radius = (P + B - H) / 2;
printf("Right triangle sides: P=%.1f, B=%.1f, H=%.1f<br>", P, B, H);
printf("Inradius: %.2f<br>", radius);
area = PI * radius * radius;
printf("Area of incircle: %.6f<br>", area);
return 0;
}
Right triangle sides: P=3.0, B=4.0, H=5.0 Inradius: 1.00 Area of incircle: 3.141593
Key Points
- The inradius formula r = (P + B − H) / 2 only works for right triangles
- For a 3-4-5 triangle, the inradius is 1 unit
- The area calculation uses the standard circle area formula ?*r²
Conclusion
The incircle area of a right triangle can be efficiently calculated using the inradius formula combined with the circle area formula. This method works for any right triangle given its three sides.
Advertisements
