Triangle Calculator

Solve any triangle from three known measurements — sides, angles, area and perimeter, with the laws of sines and cosines doing the work behind the scenes.

#geometry#triangle#law-of-sines#law-of-cosines#heron#math

The three labels under "Value 1/2/3" follow the order shown in brackets above. Angles are in degrees; sides share any single length unit.

Area

6 square units

Side a
3
Side b
4
Side c
5
Angle A
36.87°
Angle B
53.13°
Angle C
90°
Perimeter
12

Side a is opposite angle A, b opposite B, c opposite C. SSS uses the law of cosines for the angles; SAS uses the law of cosines for the third side then the law of sines for the remaining angles; ASA and AAS use the angle sum (180°) and the law of sines. Area comes from Heron's formula.

How to use this calculator

Pick the case that matches what you already know. SSS means you have all three sides; enter them as Value 1 = a, Value 2 = b, Value 3 = c. SAS means two sides and the angle between them; enter side a, side b and the included angle C (in degrees). ASA means two angles with a side between them; enter angle A, side c and angle B. AAS means two angles and a side that is not between them; enter angle A, angle B and side a (the side opposite angle A). The calculator returns the remaining three measurements along with area and perimeter. Side and angle labels follow the standard convention that side a is opposite angle A, side b is opposite angle B, and side c is opposite angle C.

How the calculation works

Three independent measurements are enough to fix a triangle uniquely in four of the five classical cases. SSS uses the law of cosines rearranged for an angle: cos(A) = (b² + c² − a²)/(2bc). SAS feeds the included angle into the law of cosines for the missing side, c² = a² + b² − 2ab·cos(C), then the law of sines finds the remaining angles. ASA and AAS both rely on the fact that angles in a triangle sum to 180°: the third angle drops out by subtraction, then the law of sines, a/sin(A) = b/sin(B) = c/sin(C), produces the missing sides. Area is computed by Heron's formula, area = √(s(s−a)(s−b)(s−c)) with s = (a+b+c)/2 — it agrees with ½·a·b·sin(C) but only needs the sides. The fifth classical case, SSA (two sides and a non-included angle), is omitted from this calculator because it can yield zero, one or two valid triangles depending on the inputs.

Worked example

A 3-4-5 right triangle entered as SSS: cos(A) = (16 + 25 − 9)/(2·4·5) = 0.8, so A = 36.87°. Cos(B) = (9 + 25 − 16)/(2·3·5) = 0.6, so B = 53.13°. C = 180 − 36.87 − 53.13 = 90°, confirming the right angle. Heron's formula with s = 6 gives area = √(6·3·2·1) = √36 = 6 square units, and perimeter = 12. For SAS, take a = 1, b = 1, included angle C = 90°: c = √(1 + 1 − 0) = √2, A = B = 45°, area = ½. For ASA with A = 60°, c = 1, B = 60°: C = 60°, all sides equal 1, area = √3/4 ≈ 0.4330 — the equilateral triangle.

Frequently asked questions

What does SSS, SAS, ASA and AAS mean?

They are the four "congruence" cases of classical geometry — each fixes a unique triangle from three pieces of information. SSS is three sides. SAS is two sides plus the angle between them (the "included" angle). ASA is two angles plus the side between them. AAS is two angles plus a side that is not between them. There is a fifth case, SSA, which is intentionally not offered here because two sides plus a non-included angle can describe zero, one or two real triangles depending on the values — the so-called ambiguous case.

What is the law of cosines?

The law of cosines generalises the Pythagorean theorem to any triangle: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. When C is 90° the cosine is zero and the equation collapses to the Pythagorean theorem a² + b² = c². Rearranged for an angle it gives cos(C) = (a² + b² − c²)/(2ab), which is how this calculator finds angles in the SSS case.

What is the law of sines?

The law of sines says that in any triangle the ratio of each side to the sine of its opposite angle is the same: a/sin(A) = b/sin(B) = c/sin(C). The shared ratio equals the diameter of the triangle's circumscribed circle. The calculator uses this rule to find sides whenever it already knows an angle and the side opposite it (ASA, AAS and the second step of SAS).

What is Heron's formula?

Heron's formula computes the area of a triangle from its three side lengths alone, without needing an angle or a height. Let s = (a + b + c)/2 be the semi-perimeter; the area is √(s(s−a)(s−b)(s−c)). It is attributed to Heron of Alexandria (1st century AD). This calculator uses it in every mode because once all three sides are known, Heron is numerically stable and avoids the trigonometric error that can creep in when angles are computed from rounded sides.

Why is SSA not supported?

SSA — two sides and an angle that is not between them — is the famously ambiguous case. Depending on whether the given side opposite the known angle is shorter than, equal to, or longer than the height it would need to reach across from the other side, there can be no solution, one solution, or two solutions. Forcing a single answer would hide that ambiguity from the user and could give incorrect geometry. If you have an SSA setup, sketch it on paper or use a dedicated ambiguous-case solver.

What units should I use?

Angles are always in degrees. Side lengths can be in any single unit you like — metres, feet, inches, centimetres — as long as you use the same unit for all sides. The area then comes back in that unit squared (so metres in gives square metres out), and the perimeter is in the same length unit. The triangle formulas themselves are scale-free, which is why the calculator does not require unit selection.