Law of Cosines Calculator
Law of Cosines Calculator
The Law of Cosines is a fundamental theorem in trigonometry that relates the lengths of the sides of a triangle to the cosine of one of its angles. It is essentially a generalization of the Pythagorean theorem that applies to all triangles, not just right-angled ones.
What is the Law of Cosines?
In any triangle with sides , , and , and angles opposite those sides , , and , the Law of Cosines states:
This formula is incredibly powerful because it allows you to solve for a missing side when you know two sides and the included angle (SAS), or to find any angle when you know all three side lengths (SSS).
When to Use This Calculator
You should use the Law of Cosines in two specific scenarios:
- Side-Angle-Side (SAS): You know the lengths of two sides and the measure of the angle between them. The calculator will find the third side and the remaining two angles.
- Side-Side-Side (SSS): You know the lengths of all three sides. The calculator will determine the measures of all three internal angles.
If you have a Side-Angle-Angle (SAA) or Angle-Side-Angle (ASA) situation, you should use the Law of Sines instead.
The Formulas
Solving for a Side (SAS)
To find side :
Solving for an Angle (SSS)
To find angle :
How to Use This Calculator
- Select your Mode: Choose between "SAS" (Side-Angle-Side) or "SSS" (Side-Side-Side).
- Enter Known Values: Input the side lengths and/or angle provided in your problem.
- Review Results: The calculator will instantly provide the missing side/angles, the perimeter, and the area of the triangle.
- Follow the Steps: Check the "Step-by-Step" section to see the exact substitution into the Law of Cosines formula.
Worked Examples
Example 1: SAS Case
Given: Side , Side , and Angle .
- Apply the formula: .
- .
- .
- .
Example 2: SSS Case
Given: Side , Side , Side .
- Apply the formula for Angle : .
- .
- . This confirms that an 8-6-10 triangle is a right triangle!
Limitations and Rules
- Triangle Inequality Theorem: For any triangle, the sum of any two sides must be strictly greater than the third side (). If your inputs violate this, a triangle cannot exist.
- Angle Sum: The sum of all internal angles in a Euclidean triangle is always .
- Domain of Arccos: When solving for angles (SSS), the value of must be between -1 and 1. If it is not, the sides provided cannot form a closed triangle.
Frequently Asked Questions
Can I use the Law of Cosines on a right triangle?
Yes! If the angle is , . The formula then simplifies to , which is the Pythagorean theorem.
What is the difference between Law of Sines and Law of Cosines?
The Law of Sines relates the ratio of sides to the sine of their opposite angles. It is best for AAS or ASA cases. The Law of Cosines is best for SAS or SSS cases where the Law of Sines would result in two unknowns.
Why is my angle result coming out as an error?
This usually happens in SSS mode if the side lengths you entered do not satisfy the Triangle Inequality Theorem. For example, sides 1, 2, and 10 cannot form a triangle because is not greater than 10.
Can Law of Cosines result in two possible triangles?
No. Unlike the Law of Sines (which has an "ambiguous case" or SSA), the Law of Cosines always yields a unique solution for the triangle if the inputs are valid.
Does the calculator use degrees or radians?
This calculator defaults to degrees for angle inputs and outputs, as this is the standard for most geometry and trigonometry homework. If you need radians, multiply the degree result by .
What is the "included angle" in SAS?
The included angle is the angle located between the two known sides. For sides and , the included angle is .