Law of Cosines Calculator

Effortlessly solve for unknown sides or angles in any triangle using the Law of Cosines. Just input your known values and let our calculator do the rest!

Input Values

Enter the known sides and angles of your triangle. Select the value you wish to calculate.

Triangle Visualization

Understanding the Law of Cosines

The Law of Cosines (also known as the Cosine Rule) is fundamental in trigonometry for solving triangles. It relates the lengths of the sides of a triangle to the cosine of one of its angles.

Formula: For a triangle with sides a, b, c and angles A, B, C opposite to these sides respectively, the Law of Cosines states:

$$c^2 = a^2 + b^2 - 2ab \cos(C)$$

This formula can be rearranged to solve for any side or angle, provided you have enough information (like two sides and the included angle, or all three sides). It's a generalization of the Pythagorean theorem, which it becomes if angle C is a right angle (90 degrees or π/2 radians), because the cosine of 90 degrees is zero.

Use Cases:

Learn more about the Law of Cosines on Wikipedia.