Final answer:
To find the area of a triangle using Heron's formula, you need the lengths of all three sides. The algorithm involves calculating the semiperimeter and then using it along with the side lengths to calculate the area using the provided formula.
Step-by-step explanation:
To design an algorithm to find the area of a triangle using the formula provided, we require the lengths of all three sides of the triangle. Here is a step-by-step algorithm:
- Collect the lengths of the sides of the triangle, named a, b, and c.
- Calculate the semiperimeter (s) by adding the sides and dividing by 2: s = (a + b + c) / 2.
- Use the formula for the area: area = √s(sa)(s-b)(s-c) to compute the area of the triangle.
- Return the computed area.
To execute this algorithm, we need the values of a, b, and c only. Note that this formula is known as Heron's formula and does not require knowledge of the height of the triangle, only the lengths of its sides.