Law of Cosines Calculator
Solve triangles using the Law of Cosines. Perfect for SAS and SSS cases with step-by-step solutions.
Enter Known Values
Law of Cosines Formulas:
a² = b² + c² - 2bc·cos(A)
b² = a² + c² - 2ac·cos(B)
c² = a² + b² - 2ab·cos(C)
Frequently Asked Questions
What is the Law of Cosines?
The Law of Cosines is a formula that relates the lengths of the sides of a triangle to the cosine of one of its angles. It's expressed as: c² = a² + b² - 2ab·cos(C), where c is the side opposite to angle C, and a and b are the other two sides.
When should I use the Law of Cosines?
Use the Law of Cosines when you know: (1) Three sides (SSS case) - to find all angles, or (2) Two sides and the included angle (SAS case) - to find the third side and remaining angles. For other cases, the Law of Sines may be more efficient.
How is the Law of Cosines related to the Pythagorean theorem?
The Law of Cosines is actually a generalization of the Pythagorean theorem. When angle C is 90°, cos(90°) = 0, and the formula reduces to c² = a² + b², which is the Pythagorean theorem. The Law of Cosines works for all triangles, not just right triangles.
What is the SSS case?
SSS stands for Side-Side-Side, meaning you know all three side lengths of the triangle. Using the Law of Cosines, you can calculate all three angles. This is one of the most common applications of the Law of Cosines.
What is the SAS case?
SAS stands for Side-Angle-Side, meaning you know two sides and the angle between them (the included angle). The Law of Cosines allows you to find the third side, and then you can use either law to find the remaining angles.
Can the Law of Cosines give negative results?
The sides of a triangle are always positive, but during calculation, the expression (a² + b² - c²) can be negative if angle C is obtuse (greater than 90°). This is normal - the cosine of obtuse angles is negative.
What is the triangle inequality?
The triangle inequality states that the sum of any two sides of a triangle must be greater than the third side. If this condition isn't met, no triangle can exist with those side lengths. Our calculator checks this automatically.
How accurate are the calculations?
The calculator uses JavaScript's built-in Math functions which provide double-precision floating-point accuracy. Results are displayed to 4 decimal places for sides and 2 decimal places for angles, which is sufficient for most practical applications.