How the calculator solves a triangle
Any three independent measurements of a triangle fix it — provided at least one is a side. The calculator looks at which three you entered, picks the right law, and shows the working. The one case with a twist is two sides and an angle that is not between them: the law of sines can then admit two different triangles, and both are reported.
| Given | Case | Method | Notes |
|---|---|---|---|
| Three sides | SSS | Law of cosines for each angle | Sides must satisfy the triangle inequality |
| Two sides and the angle between them | SAS | Law of cosines for the third side, then the angles | Always exactly one triangle |
| Two sides and an angle opposite one of them | SSA | Law of sines | May give two triangles, one, or none — the ambiguous case |
| Two angles and any side | ASA / AAS | Third angle from 180°, then law of sines | Always exactly one triangle |
| Three angles | AAA | — | Fixes the shape only; no size without a side |
The Pythagorean theorem
In any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². The hypotenuse is always the longest side and always sits opposite the right angle.
Rearranged, the theorem finds any missing side. Given both legs, c = √(a² + b²). Given the hypotenuse and one leg, the other leg is √(c² − a²). This second form requires the hypotenuse to be longer than the known leg — otherwise no such triangle exists. For a right triangle, enter the two known sides and 90° for the angle between the legs, or the three sides if you have them.
The law of sines and the law of cosines
These two relations extend right-triangle trigonometry to every triangle. The law of sines says each side is proportional to the sine of its opposite angle, which links any angle–side pair to any other. The law of cosines generalises Pythagoras with a correction term for the included angle, and collapses back to a² + b² = c² when that angle is 90°, because cos 90° = 0.
| Quantity | Formula | Notes |
|---|---|---|
| Law of sines | a ÷ sin A = b ÷ sin B = c ÷ sin C | Any two angle–side pairs |
| Law of cosines | c² = a² + b² − 2ab cos C | Reduces to Pythagoras when C = 90° |
| Angle sum | A + B + C = 180° | Third angle from two |
| Area (two sides, included angle) | ½ ab sin C | |
| Area (Heron) | √[s(s−a)(s−b)(s−c)], s = (a+b+c)/2 | From three sides only |
| Height to side a | 2 × area ÷ a | |
| Inradius | area ÷ s | Circle touching all three sides |
| Circumradius | a ÷ (2 sin A) | Circle through all three corners |
Finding the angles
The three trigonometric ratios relate the angles to the sides of a right triangle. For an acute angle θ: sin θ is the opposite side over the hypotenuse, cos θ is the adjacent over the hypotenuse, and tan θ is the opposite over the adjacent. The mnemonic SOH-CAH-TOA encodes all three.
In a general triangle the law of cosines does the same job: cos A = (b² + c² − a²) ÷ 2bc gives any angle from three sides. The angles of every triangle total 180°, which is a quick check on any result — and in a right triangle the two acute angles therefore sum to exactly 90°.
| Angle | Radians | sin | cos | tan |
|---|---|---|---|---|
| 0° | 0 | 0 = 0.0000 | 1 = 1.0000 | 0 = 0.0000 |
| 30° | 0.1667π | 1/2 = 0.5000 | √3/2 = 0.8660 | √3/3 = 0.5774 |
| 45° | 0.25π | √2/2 = 0.7071 | √2/2 = 0.7071 | 1 = 1.0000 |
| 60° | 0.3333π | √3/2 = 0.8660 | 1/2 = 0.5000 | √3 = 1.7321 |
| 90° | 0.5π | 1 = 1.0000 | 0 = 0.0000 | undefined |
Area and special triangles
For a right triangle the area is half the product of the legs. For any triangle it is half the product of two sides and the sine of the angle between them, or — from three sides alone — Heron's formula, which is what the calculator applies after solving.
Several triangles have exact integer or simple radical relationships worth recognizing. Pythagorean triples such as 3-4-5, 5-12-13, and 8-15-17 have whole-number sides. The 45-45-90 triangle has legs of equal length and a hypotenuse of leg × √2. The 30-60-90 triangle has sides in the ratio 1 : √3 : 2, which appears constantly in geometry and trigonometry.
| Triangle | Side ratio | Notes |
|---|---|---|
| 45-45-90 | 1 : 1 : √2 | Half a square; legs equal, hypotenuse leg × 1.4142 |
| 30-60-90 | 1 : √3 : 2 | Half an equilateral triangle; short leg is half the hypotenuse |
| Equilateral | 1 : 1 : 1, all angles 60° | Area = (√3 ÷ 4) × side² |
| 3-4-5 and multiples | 3 : 4 : 5 | Whole-number right triangle used to check square corners |
Pythagorean triples
Whole-number right triangles. Every multiple of a triple is also a triple, and every primitive triple comes from Euclid's formula: for whole numbers m > n, the sides m² − n², 2mn and m² + n² always work.
| Primitive triple | Some multiples |
|---|---|
| 3, 4, 5 | 6-8-10, 9-12-15, 12-16-20 |
| 5, 12, 13 | 10-24-26, 15-36-39 |
| 8, 15, 17 | 16-30-34 |
| 7, 24, 25 | 14-48-50 |
| 20, 21, 29 | 40-42-58 |
| 9, 40, 41 | 18-80-82 |
Where this gets used
Triangles answer a lot of practical questions. Construction uses the 3-4-5 triple to check that corners are square without a protractor. Navigation and mapping use the law of cosines for distance between two points seen from a third. Screen and television sizes are quoted as the diagonal, which is the hypotenuse of the display's width and height. Surveyors measure one baseline and two angles, then let the law of sines supply the distances they cannot walk.
It also generalizes: the distance formula between two points in a plane, √((x₂−x₁)² + (y₂−y₁)²), is the Pythagorean theorem applied to the horizontal and vertical separation.