Ad Space — Top Banner

Law of Cosines Calculator

Solve any triangle using the Law of Cosines.
Enter sides and angles to find unknown measurements, area, and perimeter.

Triangle Solution

The Law of Cosines is a fundamental formula in trigonometry that relates the lengths of the sides of a triangle to the cosine of one of its angles. It is a generalization of the Pythagorean theorem, which only works for right triangles.

The formula:

c² = a² + b² − 2ab × cos(C)

Where:

  • a and b are two known sides of the triangle
  • C is the angle between sides a and b (the included angle)
  • c is the side opposite to angle C

When to use the Law of Cosines:

You use this formula in two main situations. First, when you know two sides and the included angle (SAS) and want to find the third side. Second, when you know all three sides (SSS) and want to find any angle.

Solving for an angle (SSS case):

Rearranging the formula gives: C = arccos((a² + b² − c²) / (2ab))

Practical examples:

Surveyors use the Law of Cosines to calculate distances that cannot be measured directly. For instance, if you can measure two distances from a reference point to two landmarks and the angle between them, you can calculate the distance between the landmarks. Navigation, engineering, and architecture all rely on this formula regularly.

Relationship to the Pythagorean theorem: When angle C is exactly 90 degrees, cos(90°) = 0, so the formula simplifies to c² = a² + b², which is the familiar Pythagorean theorem. This makes the Law of Cosines a more general and powerful tool.

Tips:

  • Angles must be in degrees for this calculator (0° to 180°).
  • The sum of all angles in any triangle is always exactly 180°.
  • If a calculated angle comes out negative or greater than 180°, the triangle is invalid.
  • To find the area after solving, use: Area = ½ × a × b × sin(C).

Ad Space — Bottom Banner

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.