Understanding the triangle calculator — concept and principle
Given the lengths of all three sides of a triangle, this calculator finds its area, its three angles, its perimeter, whether it is acute, right or obtuse, whether it is scalene, isosceles or equilateral, and the radii of its inscribed and circumscribed circles. It is useful in geometry homework, surveying a plot of land from measured sides, carpentry and checking whether a corner is square.
How it is calculated
- Validity: each side must be shorter than the sum of the other two (triangle inequality).
- Semi-perimeter: s = (a + b + c) ÷ 2.
- Area (Heron's formula): K = √(s(s − a)(s − b)(s − c)).
- Angles (law of cosines): cos A = (b² + c² − a²) ÷ (2bc), cos B = (a² + c² − b²) ÷ (2ac), C = 180° − A − B. Angle A is opposite side a, and so on.
- Type by angle: compare the longest side squared with the sum of the squares of the other two: equal means right, larger means obtuse, smaller means acute.
- Inradius: r = K ÷ s. Circumradius: R = abc ÷ (4K).
Use one unit for all sides; the area comes out in that unit squared.
The principle
The law of cosines, c² = a² + b² − 2ab cos C, generalises the Pythagorean theorem: the correction term −2ab cos C vanishes when C = 90°, is positive for an obtuse C and negative for an acute C. That is why comparing c² with a² + b² classifies the triangle. Heron's formula comes from combining area = ½ab sin C with the law of cosines and factoring the result, so the area follows from the sides alone. The inradius follows from splitting the triangle into three smaller triangles with height r, giving K = r·s.
Worked example
- Default inputs: a = 3, b = 4, c = 5.
- s = (3 + 4 + 5) ÷ 2 = 6. Area: √(6 × 3 × 2 × 1) = √36 = 6.
- cos A = (16 + 25 − 9) ÷ 40 = 0.8, so A = 36.86989765°. cos B = (9 + 25 − 16) ÷ 30 = 0.6, so B = 53.13010235°. C = 90°.
- Perimeter = 12.
- 5² = 25 = 3² + 4², and all sides differ: scalene, right.
- r = 6 ÷ 6 = 1; R = 60 ÷ 24 = 2.5.
How to read the result
In a right triangle the circumradius is half the hypotenuse (here 5 ÷ 2), because the hypotenuse is a diameter of the circumscribed circle. A very small area compared with the side lengths means the triangle is nearly flat. The largest angle is always opposite the longest side.
Common mistakes
- Entering sides that violate the triangle inequality, such as 2, 3, 6.
- Mixing units (metres and centimetres) between sides.
- Matching angles to the wrong sides: A is opposite a.
Frequently asked questions
How can I check if a corner is square?
Use the 3-4-5 rule: measure 3 units along one side and 4 along the other; the diagonal should be exactly 5.
Can I find the area if I know two sides and the angle between them?
Yes: area = ½ab sin C.
Why is 3-4-5 called a Pythagorean triple?
Its whole-number sides satisfy a² + b² = c². Others include 5-12-13 and 8-15-17.
Sources: Heath, T. L. (trans.), The Thirteen Books of Euclid's Elements, Book II, Propositions 12–13 · Coxeter, H. S. M., Introduction to Geometry, Wiley