Triangle Calculator: Area, Angles, and Properties
A triangle calculator determines the area, perimeter, angles, and classification of a triangle from its three side lengths. It uses well-established geometric formulas including Heron's formula for area and the law of cosines for angles.
Heron's Formula
Heron's formula calculates the area of a triangle when all three sides are known, without needing the height.
s = (a + b + c) / 2
Area = √(s(s-a)(s-b)(s-c))
Where s is the semi-perimeter and a, b, c are the side lengths.
Law of Cosines
The law of cosines finds each angle when all three sides are known:
cos(A) = (b² + c² - a²) / (2bc)
Triangle Classification
- Equilateral: All three sides are equal, all angles are 60 degrees.
- Isosceles: Two sides are equal, two angles are equal.
- Scalene: All sides and angles are different.
- Right: One angle is exactly 90 degrees (Pythagorean theorem applies).
Frequently Asked Questions
What makes a valid triangle?
A valid triangle must satisfy the triangle inequality theorem: the sum of any two sides must be greater than the third side. All sides must also be positive numbers.
How accurate are the angle calculations?
The angles are calculated using the inverse cosine function with JavaScript's built-in math library, providing precision to at least 10 decimal places. Results are displayed rounded to 4 decimal places.