šŸ“ Law of Cosines Calculator

Calculate triangle sides and angles

How to Use This Calculator

1

Select What to Find

Choose whether you want to find a missing side (c) or a missing angle (C).

2

Enter Known Values

Input the known sides and angles. For finding a side: enter sides a and b, plus angle C. For finding an angle: enter all three sides a, b, and c.

3

Calculate

Click "Calculate" to get the missing side or angle using the Law of Cosines.

4

Review Results

Check the calculated value and review the formula that was used.

Formula

c² = a² + b² - 2ab·cos(C)

Law of Cosines

To Find a Side:

c² = a² + b² - 2ab·cos(C)

Given: sides a and b, and included angle C

To Find an Angle:

cos(C) = (a² + b² - c²) / (2ab)

Given: all three sides a, b, and c

When to Use:

  • Any triangle (not just right triangles)
  • When you know two sides and the included angle (find third side)
  • When you know all three sides (find any angle)
  • Alternative to Law of Sines when applicable

About Law of Cosines Calculator

The Law of Cosines Calculator finds missing sides or angles in any triangle using the Law of Cosines. This law is a generalization of the Pythagorean theorem and works for all triangles, including non-right triangles. It's essential for solving triangles when you know two sides and the included angle, or all three sides.

What is the Law of Cosines?

The Law of Cosines states that for any triangle with sides a, b, c and angle C opposite side c: c² = a² + b² - 2ab·cos(C). When C = 90°, cos(C) = 0, so this reduces to the Pythagorean theorem: c² = a² + b².

When to Use This Calculator

  • SAS (Side-Angle-Side): When you know two sides and the included angle
  • SSS (Side-Side-Side): When you know all three sides and need to find angles
  • Navigation: Calculate distances using bearing and distance data
  • Surveying: Determine unknown measurements in triangular plots
  • Physics: Solve force vector problems

Why Use Our Calculator?

  • āœ… Flexible: Can find either missing sides or angles
  • āœ… Formula Display: Shows the exact formula used with your values
  • āœ… Accurate: Precise calculations using standard Law of Cosines
  • āœ… 100% Free: No registration required
  • āœ… Educational: Helps understand the Law of Cosines

Frequently Asked Questions

When should I use Law of Cosines vs Law of Sines?

Use Law of Cosines when you have SAS (two sides and included angle) or SSS (all three sides). Use Law of Sines when you have AAS or ASA (two angles and a side).

How is Law of Cosines related to the Pythagorean theorem?

The Law of Cosines is a generalization of the Pythagorean theorem. When the angle is 90°, cos(90°) = 0, and the Law of Cosines reduces to a² + b² = c².

Can I use Law of Cosines for right triangles?

Yes, but the Pythagorean theorem is simpler. The Law of Cosines works for all triangles, including right triangles, but it's more complex than necessary for right triangles.

What if the angle I get is greater than 180°?

This shouldn't happen with valid triangle inputs. If you get an angle ≄ 180°, check your inputs - the triangle may not be valid (e.g., sides don't satisfy triangle inequality).

Can this calculator handle obtuse triangles?

Yes! The Law of Cosines works perfectly for all triangles, including obtuse triangles (where one angle > 90°).