Cosine Rule Calculator
Use this calculator to solve triangles with the cosine rule (also called the law of cosines). Choose whether you want to find a missing side or a missing angle.
Find an angle: cos(C) = (a² + b² - c²) / 2ab
Angle C must be between 0° and 180° (exclusive).
What is the cosine rule?
The cosine rule is a triangle formula that connects all three side lengths and one angle. It is especially useful when you do not have a right triangle, which makes basic Pythagoras incomplete by itself.
You will usually use it in two situations:
- SAS case: you know two sides and the included angle, and need the third side.
- SSS case: you know all three sides and need an angle.
Cosine rule formulas
1) Finding a missing side
If you know sides a and b and included angle C, then:
c² = a² + b² - 2ab cos(C)
Then take the square root to get c.
2) Finding a missing angle
If you know sides a, b, and c, then:
cos(C) = (a² + b² - c²) / (2ab)
Then use inverse cosine (arccos) to get the angle in degrees.
How to use this cosine rule calculator
- Select the calculation type from the dropdown.
- Enter the required side lengths and/or angle.
- Click Calculate.
- The result box shows the answer and extra triangle details when available.
Worked examples
Example A: find a side
Suppose a = 8, b = 11, and C = 42°.
Using the formula: c² = 8² + 11² - 2(8)(11)cos(42°). After evaluating, you get c as the positive square root. This calculator performs those steps instantly and reduces rounding mistakes.
Example B: find an angle
Suppose a = 7, b = 10, and c = 12.
Use cos(C) = (7² + 10² - 12²)/(2·7·10). Then compute C = arccos(...). The calculator handles this and returns the angle in degrees.
Common mistakes to avoid
- Using an angle that is not the included angle for the SAS formula.
- Entering degrees but calculating as if values are radians.
- For SSS problems, forgetting triangle inequality (e.g., 2, 3, 9 cannot form a triangle).
- Rounding too early in multi-step hand calculations.
Cosine rule vs sine rule
Use the cosine rule when your known values are SAS or SSS. Use the sine rule more naturally in ASA, AAS, or SSA-style setups (with care in ambiguous SSA cases). In practical problem solving, both rules often appear together in the same question.
Where this is used in real life
- Surveying and land measurement
- Navigation and route planning
- Engineering layouts and structural analysis
- Computer graphics and geometry engines
Final tip
Always sketch the triangle, label known values clearly, and decide whether your data pattern is SAS or SSS before choosing the formula. A quick diagram prevents most setup errors.