Law of Cosines Calculator
Solve a triangle using the cosine rule: c² = a² + b² − 2ab·cos C.
Inputs
Side c
6.244998
Angle A
43.897886°
Angle B
76.102114°
Step by step
Apply cosine rule
c² = 5² + 7² − 2·5·7·cos(60°)
= 39
Side c
c = √39
= 6.244998
Angle A
A = arccos((b²+c²−a²)/(2bc))
= 43.89788625°
Angle B
B = 180° − A − C
= 76.10211375°
How it works
The Law of Cosines generalises the Pythagorean theorem to any triangle: c² = a² + b² − 2ab·cos C. Use it for SAS (two sides + included angle) or SSS (three sides) configurations.
Formula
Law of Cosines
c² = a² + b² − 2ab·cos C
- a
- First side
- b
- Second side
- c
- Side opposite angle C
- C
- Included angle
Frequently Asked Questions
How does the Law of Cosines relate to the Pythagorean theorem?
When C = 90°, cos(90°) = 0, so it reduces to c² = a² + b², which is exactly the Pythagorean theorem.
Can I use Law of Cosines if I know two angles?
If you know two angles, you know the third (they sum to 180°). The Law of Sines is simpler in that case. Law of Cosines is best for SSS or SAS.