Complete the following method that calculates and returns the area of a triangle using heron's formula. to use heron's formula, first calculate half of the perimeter of the triangle, and store it in a variable named s. then calculate s(s - a)(s - b)(s - c), where a, b, and c are the lengths of the sides of the triangle, and the values are multiplied. the area is then the square root of that value.(10 points) the perimeter of a triangle is the sum of the lengths of the sides. public static double area(double side1, double side2, double side3) { }
We typically can determine or are given the sides of a triangle when a triangle is present. A formula does exist that can calculate the area of a triangle when all three sides are known.
Step-by-step explanation:
Public static double area(double side1, double side2, double side3)
{
double s = (side1 + side2 + side3) / 2.0;
return Math.Sqrt(s * (s - side1) * (s - side2) * (s - side3));
}
The area of ΔABC is 6√6 sq. yards.
Step-by-step explanation:
The area of a triangle using the Heron's formula is:
[tex]A=\sqrt{s\cdot (s-a)\cdot (s-b)\cdot (s-c)}[/tex]
Here s is given as follows:
[tex]s=\frac{a+b+c}{2}[/tex]
The sides of the triangle ABC are as follows:
AB = 6 yd
BC = 7 yd
CA = 5 yd
Compute the value of s as follows:
[tex]s=\frac{a+b+c}{2}[/tex]
[tex]=\frac{6+7+5}{2}\\\\=9[/tex]
Compute the area of ΔABC as follows:
[tex]A=\sqrt{s\cdot (s-a)\cdot (s-b)\cdot (s-c)}[/tex]
[tex]=\sqrt{9\cdot(9-6)\cdot(9-7)\cdot(9-5)}\\\\=\sqrt{9\times 3\times 2\times 4}\\\\=\sqrt{216}\\\\=\sqrt{36\times 6}\\\\=6\sqrt{6}[/tex]
Thus, the area of ΔABC is 6√6 sq. yards.
D. 37.947
Step-by-step explanation:
Heron's formula makes use of the value "s", the semi-perimeter. Here, ...
s = (7 + 11 + 12)/2 = 15
Then the area is ...
A = √(s(s -a)(s -b)(s -c)) = √(15·3·4·8) = √1440 = 12√10 ≈ 37.947
_____
Comment on answer choices
This value is verified by a triangle solver. We suspect a typographical error in the answer choices, specifically, selection D.
[tex]In geometry, heron's formula (sometimes called hero's formula), named after hero of alexandria, give[/tex]