Calculating the area of a triangle is a very fundamental problem statement. Here I am explaining the calculation of the area of a triangle using Heron's Formula.
What is Heron's Formula ?
This is a formula which has been in use from the past 2000 year. We can easily calculate the area of a triangle if we know the measurement of all the three sides of a triangle.
As shows in the picture above, if we know all the sides of the triangle a, b and c. We will be able to apply Heron's formula.
Area = (s(s-a) * (s-b) * (s-c)) ^ 0.5
where s = (a+b+c) / 2
We will use the above formula in a python program and make a utility to calculate the area in a programmatic way.
No comments:
Post a Comment