The formula
Angles: A + B + C = 180°
Law of sines: a/sin A = b/sin B = c/sin C = 2R
Law of cosines: c² = a² + b² − 2ab·cos C
Heron's formula: area = √(s(s − a)(s − b)(s − c)), where s = (a + b + c)/2
Inradius r = area ÷ s; circumradius R = a ÷ (2 sin A)
Worked example
- Sides a = 5, b = 7, c = 9 (SSS).
- cos A = (7² + 9² − 5²) ÷ (2 × 7 × 9) = 105 ÷ 126 = 0.8333, so A = 33.56°.
- cos B = (5² + 9² − 7²) ÷ (2 × 5 × 9) = 57 ÷ 90 = 0.6333, so B = 50.70°, and C = 95.74°.
- s = 10.5, area = √(10.5 × 5.5 × 3.5 × 1.5) = √303.19 = 17.41.
- The largest angle is over 90°, so this is an obtuse scalene triangle.
Solving a triangle
Every triangle has three sides and three angles, and if you know three of these six values, including at least one side, you can usually find the rest. The calculator labels the sides a, b and c, with angles A, B and C opposite them. Choose the combination you know: three sides (SSS), two sides and the angle between them (SAS), two angles and the side between them (ASA), two angles and another side (AAS), or two sides and an angle that isn't between them (SSA). For a right triangle where you know the two shorter sides, choose the right-triangle option.
The law of cosines
The law of cosines generalises Pythagoras' theorem to any triangle: c² = a² + b² − 2ab·cos C. When C is 90°, the cosine is zero and it becomes c² = a² + b². Use it to find the third side when you know two sides and the angle between them (SAS), or rearrange it to find each angle when you know all three sides (SSS): cos C = (a² + b² − c²) ÷ 2ab. It's numerically reliable for every angle, which is why the calculator uses it for these cases.
The law of sines and the ambiguous case
The law of sines says each side divided by the sine of its opposite angle gives the same value, equal to the diameter of the triangle's circumscribed circle. It solves ASA and AAS triangles directly. The SSA case is tricky because the sine of an angle and of its supplement are equal, so two different triangles can sometimes fit the same information. This happens when the side opposite the known angle is shorter than the other known side but longer than the height. The calculator finds both triangles when this happens and shows the second in the notes.
Area, heights and radii
The area comes from Heron's formula, which needs only the three sides: area = √(s(s − a)(s − b)(s − c)), where s is half the perimeter. You could also use ½ab·sin C. Each height (altitude) is twice the area divided by the side it's drawn to. The inradius is the radius of the largest circle that fits inside the triangle, touching all three sides, and the circumradius is the radius of the circle passing through all three corners. These are useful in design, surveying and engineering problems.
Types of triangle
Triangles are classified by their sides and by their angles. An equilateral triangle has three equal sides and three 60° angles, an isosceles triangle has two equal sides and two equal angles, and a scalene triangle has no equal sides. By angles, a triangle is acute if every angle is under 90°, right if one is exactly 90° and obtuse if one is over 90°. A quick test with sides alone: if c is the longest side, the triangle is right when c² = a² + b², obtuse when c² is larger and acute when it's smaller.
Practical uses
Triangle calculations are used in roofing to find rafter lengths and roof pitch, in surveying and navigation to locate points by triangulation, in carpentry to check that corners are square with the 3-4-5 method, and in physics to resolve forces into components. For quick right-angled problems, the Pythagorean theorem calculator is simpler. For roof angles, see our roofing calculator, and for angles and lengths of polygons, the polygon calculator.