Law of Cosines Calculator
A Law of Cosines calculator is a mathematical tool that solves oblique or right triangles using the generalized Pythagorean theorem: c² = a² + b² − 2ab·cos(C). Given two sides and their included angle (SAS) or all three side lengths (SSS), it calculates the remaining side length and all unknown interior angles.
Solve oblique or right triangles using side-angle-side (SAS) or side-side-side (SSS) measurements with step-by-step math.
Quick Answer
Solve missing side lengths and angles of a triangle using the Law of Cosines. Supports SAS and SSS inputs with step-by-step math.
e.g. 8
e.g. 11
e.g. 47
Solved side c
8.0603
Angle A = 46.54°, Angle B = 86.46°
Step-by-step solution
Examples
SAS: a=8, b=11, C=47°
c ≈ 8.08, A ≈ 46.54°, B ≈ 86.46°
SSS: a=8, b=11, c=14
A ≈ 34.09°, B ≈ 50.32°, C ≈ 95.59°
How it works
How the Law of Cosines Works
The Law of Cosines relates the lengths of the sides of a triangle to the cosine of one of its angles. It is formulated as:
The Standard Formulas
c² = a² + b² − 2ab · cos(C)
Rearranged for angles: cos(C) = (a² + b² − c²) / (2ab)
To solve the other oblique triangle cases (such as ASA or AAS), check out our Law of Sines calculator or use the classic Pythagorean theorem calculator if you are working with a right triangle. You can also calculate the final space with our triangle area calculator.
Triangle Inequality Theorem
For three side lengths to form a real triangle, they must satisfy the triangle inequality: the sum of the lengths of any two sides must be strictly greater than the length of the remaining side. If this condition is not met (for example, sides 3, 4, and 8), the sides cannot connect to form a closed shape.
Related Calculators
More tools from Education



