Loading…

Law of Cosines

Math Algebra • Trigonometry Basics

View all topics

Use the Law of Cosines to solve triangles when you know two sides and the included angle or all three sides. It is especially useful for SAS and SSS cases.

Find side \(a\) \(a^2=b^2+c^2-2bc\cos A\) Find side \(b\) \(b^2=a^2+c^2-2ac\cos B\) Find side \(c\) \(c^2=a^2+b^2-2ab\cos C\) Find angle \(\cos C=\dfrac{a^2+b^2-c^2}{2ab}\)

Triangle input

Standard notation is used: side \(a\) is opposite angle \(A\), side \(b\) is opposite angle \(B\), and side \(c\) is opposite angle \(C\). For SAS, enter two sides and the included angle. For SSS, enter all three sides.

Graph and output settings

Smaller values make the triangle drawing animation slower.

Quick examples

Ready
Enter an SAS or SSS triangle, then click “Solve triangle”.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What is the Law of Cosines?

The Law of Cosines states that a² = b² + c² - 2bc cos A, with similar formulas for sides b and c.

When should I use the Law of Cosines?

Use it when you know two sides and the included angle (SAS) or all three sides (SSS).

How do I find the third side in SAS?

Use the formula for the side opposite the known included angle. For example, if a, b, and C are known, use c² = a² + b² - 2ab cos C.

How do I find an angle from three sides?

Rearrange the Law of Cosines. For example, cos C = (a² + b² - c²) / (2ab), then C = arccos of that value.

Can the calculator solve SSA?

No. SSA is usually an ambiguous Law of Sines case, so use the Law of Sines calculator instead.

Can the calculator detect invalid triangles?

Yes. For SSS cases it checks the triangle inequality and reports when no triangle is possible.

Can I export the result?

Yes. Use Download CSV to export the solved triangle values.