SAS case
- Input
- a=5, b=7, C=60°
- Expected output
- c ≈ 6,244998
c² = 25 + 49 − 2×5×7×cos(60°) = 39, and √39 ≈ 6.244998; cos(60°) = 0.5 is an exact notable value.
law of cosines
The law of cosines generalizes the Pythagorean theorem to any triangle, not just right ones. It solves the SAS case directly and returns all three angles of an SSS triangle, but it has a neighbor, the SSA case, that sometimes admits two different answers for the same input.
c² = 25 + 49 − 2×5×7×cos(60°) = 39, and √39 ≈ 6.244998; cos(60°) = 0.5 is an exact notable value.
sin(B) = 0.875 has two possible solutions between 0° and 180°, so the same three input values complete two different triangles.
2 + 3 = 5 is less than 6, violating the triangle inequality before any angle is even calculated.
The classic cases: SSS (three sides), SAS (two sides and the included angle), ASA and AAS (two angles and a side) and SSA (two sides and a non-included angle). At least one side is always required.
When C = 90°, cos(90°) = 0 eliminates the last term, leaving c² = a² + b²; the 3, 4, 5 triangle confirms this, since cos C = (9+16−25) ÷ 24 = 0.
Because arcsine can return two angles, θ and 180° − θ, with the same sine; with A = 30°, a = 4 and b = 7, sin(B) = 0.875 admits both B ≈ 61.05° and B ≈ 118.95°, forming two distinct triangles from the same input.
Apply the triangle inequality, the sum of any two sides must exceed the third; 2, 3 and 6 fail (2+3=5≤6), while 3, 4 and 5 pass (3+4=7>5), a check the calculator runs before attempting any angle.
Enter 3 measurements (with at least one side). The figure is drawn to scale.
Calculations run in your browser. No data is sent to a server.