Law of cosines calculator
Enter sides b and c and the angle A between them to get the opposite side a and the rest of the triangle.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter side b, side c and included angle a.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
a² = b² + c² - 2bc × cos A. Then cos B = (a² + c² - b²) / (2ac) and C = 180° - A - B. Area = ½ × b × c × sin A.
Example
Inputs: Side b = 5, Side c = 7, Included angle A = 60 °. Result: Side a: 6.245; Angle B: 43.8979 °; Angle C: 76.1021 °.
Limits and caveats
- The angle you enter must be the one between the two sides.
- Angles are in degrees and all lengths in one unit.
Questions about this tool
When should I use the law of cosines instead of the law of sines?
When you know two sides and the angle between them, or all three sides. The law of sines cannot start from those cases.
Is the law of cosines a general form of Pythagoras?
Yes. When A = 90°, cos A is zero and the formula becomes a² = b² + c².
Why is angle B found with the cosine rather than the sine?
The sine gives the same value for two supplementary angles, while the cosine fixes an angle between 0 and 180 without ambiguity.
