Overview:
In general, the term “area” is defined as the region occupied inside the boundary of a flat object or figure. Before, Starting this article First of all, I want to introduce you with Geometric Shape triangle. Then I will explain What do you mean by area of a triangle and Heron’s Formula? Moreover, I will demonstrate how to find area of a triangle? Furthermore, I will write logic and c program to find area of triangle with output. After all, I will explain the resultant output.
Table of contents:
- What is a Triangle?
- What are the properties of the Triangle?
- What are the types of Triangle?
- What is Right Angled Triangle?
- What is Obtuse-angled Triangle?
- What is Acute angled Triangle?
- What is Equilateral Triangle?
- What is Isosceles Triangle?
- What is Scalene Triangle?
- What do you mean by the area of a triangle?
- Demonstration how to find area of a triangle.
- Define Heron’s Formula.
- How to calculate the area of a Right Angled Triangle?
- How to calculate the area of a Obtuse-angled Triangle?
- How to calculate the area of a Acute angled Triangle?
- How to calculate the area of a Equilateral Triangle?
- How to calculate the area of a Isosceles Triangle?
- How to calculate the area of a Scalene Triangle?
- Main Logic to find the area of a triangle.
- C program to find area of triangle
- Conclusion
What is a Triangle?
A triangle is a three-sided polygon that consists of three edges and three vertices. If ABC is a triangle, then it is denoted as ∆ABC, where A, B and C are the vertices of the triangle and AB, BC, CA are the edges of the triangle. A triangle is a two-dimensional Geometric shape.
What are the properties of the Triangle?
The properties of the triangle are as follows:
- The sum of all the angles of a triangle(of all types) is equal to 180°.
- The sum of the length of the two sides of a triangle is greater than the length of the third side.
- In the same way, the difference between the two sides of a triangle is less than the length of the third side.
- The side opposite the greater angle is the longest side of all the three sides of a triangle.
- The exterior angle of a triangle is always equal to the sum of the interior opposite angles. This property of a triangle is called an exterior angle property.
- Two triangles are said to be similar if their corresponding angles of both triangles are congruent and lengths of their sides are proportional.
- Area of a triangle = ½ × Base × Height
- The perimeter of a triangle = sum of all its three sides
What are the types of Triangle?
Triangles can be broadly classified into two types, which are:
- Triangles based on the lengths of their sides
- Triangles based on their interior angles On the basis of the lengths of their sides, triangles are classified in three categories:
- Scalene Triangle
- Isosceles Triangle
- Equilateral Triangle
- Right Triangle
- Obtuse Triangle
- Acute Triangle
What is Right Angled Triangle?
A right-angled triangle, also called a right triangle has one angle at 90° and the other two acute angles sums to 90°. Therefore, the height of the triangle will be the length of the perpendicular side.
What is Obtuse-angled Triangle?
Obtuse triangles are those in which one of the three interior angles has a measure greater than 90 degrees. In other words, if one of the angles in a triangle is an obtuse angle, then the triangle is called an obtuse-angled triangle.
What is Acute angled Triangle?
An acute triangle is a triangle whose all three interior angles are acute. In other words, if all interior angles are less than 90 degrees, then it is an acute-angled triangle.
What is Equilateral Triangle?
An equilateral triangle is a triangle where all the sides are equal. The perpendicular drawn from the vertex of the triangle to the base divides the base into two equal parts.
What is Isosceles Triangle?
An isosceles triangle is one which has at least two sides of equal length. This property is equivalent to two angles of the triangle being equal.
What is Scalene Triangle?
A simple definition of a scalene triangle is “A Scalene triangle is a triangle with three different sides and angles. ” In other words, A Scalene triangle has three random(Unequal) sides/lengths and three random (Unequal) angles.
What do you mean by the area of a triangle?
The area of the triangle is the region enclosed by its perimeter or the three sides of the triangle. The standard unit for measurement of the area is meter2. In general area of the triangle is calculated by two ways as follows:
- The Basic formula for the area of the triangle: A = ½ × Base × Height(Perpendicular distance).
- The “Heron’s Formula” for the area of the triangle: √(s*(s-a)*(s-b)*(s-c));
Demonstration how to find area of a triangle:
Define Heron’s Formula.
Heron’s formula includes two important steps as follows:
- Step 1: Find the semi perimeter of a triangle by adding all the three sides of a triangle and dividing it by 2.
- Step 2: apply the semi-perimeter of triangle value in the main formula called “Heron’s Formula” to find the area of a triangle.
The main formula called “Heron’s Formula” to find the area of a triangle is as follows:
√(s × (s-a) × (s-b) × (s-c));
The measurement unit of the area of a triangle is a square unit.
How to calculate the area of a Right Angled Triangle?
The Area of a Right Triangle is calculated by using following formula:
A = ½ × Base × Height(Perpendicular distance)
How to calculate the area of a Obtuse-angled Triangle?
The area of the obtuse-angled triangle is given by: Area = 1/2 × b × h where b is the base and h is the height of the triangle.
How to calculate the area of a Acute angled Triangle?
The area of acute angle triangle = (½) × b × h square units
How to calculate the area of a Equilateral Triangle?
The Area of an Equilateral Triangle is calculated by the formula:
A = (√3)/4 × side2
How to calculate the area of a Isosceles Triangle?
The general formula for the area of the triangle is equal to half the product of the base and height of the triangle.
The area of a scalene triangle is calculated by:
A =1/2 × b × h square units.
Where,
base 'b' is any side of the triangle
height ‘h’ is an altitude on that base
How to calculate the area of a Scalene Triangle?
The area of a scalene triangle is calculated by:
A =1\2 × b × h square units.
Where,
base 'b' is any side of the triangle
height ‘h’ is an altitude on that base
Main Logic to find the area of a triangle
- Step 1: First of all declare 6 variables such as a, b,c for triangle sides, Perimeter P, semi perimeter s and Area.
- Step 1: User will enter the three sides of the triangle a, b, c.
- Step 2: Calculating the Perimeter of the Triangle using the formula P = a + b + c.
- Step 3: Calculating the semi perimeter using the formula (a + b + c)/2 and store it into variable s.
- Step 4: Calculating the Area of a triangle using Heron’s Formula: √(s × (s - a) × (s - b) × (s - c)); and store it into Area variable.
- Step 4: Print the variable area.
C program to find area of triangle
/* C Program to find Area of a Triangle and Perimeter of a Triangle */ #include <stdio.h> #include <math.h> int main() { float a, b, c, P, s, Area; printf("\nPlease! Enter First edge of the triangle: "); scanf("%f",&a); printf("\nPlease! Enter Second edge of the triangle: "); scanf("%f",&b); printf("\nPlease! Enter Third edge of the triangle: "); scanf("%f",&c); P = a + b + c; s = (a + b + c)/2; Area = sqrt(s * (s - a) * (s - b) * (s - c)); printf("\n Perimeter of the Triangle = %.2f\n", Perimeter); printf("\n Semi Perimeter of the Triangle = %.2f\n",s); printf("\n Area of the triangle = %.2f\n",Area); return 0; }
The output of the Program:
Conclusion
In this Program, User will enter the three sides of the triangle a, b, c. Then, Calculating the Perimeter of the Triangle. Moreover, calculating the semi perimeter using the formula (a + b + c) / 2 and calculating the Area of a triangle using Heron’s Formula: √(s × (s - a) × (s - b) × (s - c)). After the successful execution of the program the final area of a triangle is shown on screen.