Law of Cosine Calculator
Primary Result
Missing Side c
Secondary Data
c² = a² + b² - 2ab cos(γ)
Solve oblique triangles with ease using our professional Law of Cosine Calculator. Whether you have two sides and their included angle (SAS) or all three sides (SSS), this tool provides instant, high-precision results for all missing sides and angles. Perfect for trigonometry students, architects, and engineers.
Quick Tip: The Law of Cosines is the generalized version of the Pythagorean theorem. It works on any triangle, not just right triangles!
- Handles both SAS and SSS triangle cases
- Calculates all remaining angles and sides automatically
- Instant visualization of the used formula
Introduction to the Law of Cosines
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. While the Pythagorean theorem only applies to right triangles, the Law of Cosines works for all triangles, including acute and obtuse ones. It is an essential tool for solving triangles where the Law of Sines cannot be immediately applied.
Think of it as a "bridge" between geometry and algebra. By knowing just three pieces of information about a triangle—either two sides and the angle between them (SAS) or all three sides (SSS)—you can calculate every other measurement with absolute precision.
How to Use the Law of Cosine Calculator
Our calculator is designed to be intuitive and fast. Follow these steps to solve your triangle:
- Select Your Case: Choose "SAS" if you know two sides and the angle between them, or "SSS" if you know all three side lengths.
- Enter Your Values: Input the known measurements into the designated fields. For SAS, ensure the angle is the one located between the two sides.
- Choose Units: The calculator assumes degrees for angles, which is the standard for most engineering and school applications.
- Review Results: The tool instantly calculates the missing side (for SAS) or the missing angles (for SSS). It also provides the remaining secondary data to fully "solve" the triangle.
- Reset or Toggle: Easily switch between cases or clear all inputs using the provided controls.
How the Calculation Works
The calculator uses the three standard variations of the Law of Cosines formula depending on which side or angle is being solved:
- Side c: c² = a² + b² - 2ab cos(γ)
- Side b: b² = a² + c² - 2ac cos(β)
- Side a: a² = b² + c² - 2bc cos(α)
For the SSS case, the formula is rearranged to solve for the angle:
cos(γ) = (a² + b² - c²) / 2ab
Once the primary missing value is found, the calculator uses the Law of Sines or the triangle angle sum theorem (A + B + C = 180°) to determine the remaining parts of the triangle.
Key Factors in Triangle Validity
Not every set of numbers can form a triangle. When using this calculator, keep these geometric constraints in mind:
- Triangle Inequality Theorem: For any triangle, the sum of the lengths of any two sides must be strictly greater than the length of the third side (a + b > c). If this condition isn't met, a triangle cannot exist.
- Angle Limits: In the SAS case, the input angle must be between 0° and 180°. An angle of 0° or 180° results in a "degenerate" triangle (a straight line).
- SSS Range: In the SSS case, if the calculation `(a² + b² - c²) / 2ab` results in a value outside the range of -1 to 1, the cosine function cannot be evaluated, meaning the sides provided do not form a valid triangle.
Assumptions and Limitations
This calculator operates under the following mathematical standards:
- Euclidean Geometry: Calculations assume a flat surface. For spherical triangles (like navigating long distances on Earth), different formulas are required.
- Static Precision: Results are rounded to 4 decimal places for readability, which is sufficient for 99% of academic and professional use cases.
- Real Numbers: We assume all inputs are positive real numbers. Negative side lengths are physically impossible and will result in errors.
3 Practical Law of Cosine Examples
1. Navigation
A ship travels 10 miles, turns 45 degrees, and travels another 15 miles. How far is it from the start?
Case: SAS
Sides: 10, 15 | Angle: 135°
The angle inside the triangle is 180 - 45 = 135°.
2. Construction
A triangular roof truss has sides of 8ft, 8ft, and 12ft. What is the peak angle?
Case: SSS
Sides: 8, 8, 12
Solving for Angle C opposite the 12ft side.
3. Land Surveying
Finding the distance across a lake between two markers from a single observation point.
Case: SAS
Observation distances: 100m, 120m | Angle: 30°
Directly solves for the unreachable distance.
Quick Reference Table
Common triangle configurations and their Law of Cosine solutions.
| Side a | Side b | Angle γ | Result (Side c) |
|---|---|---|---|
| 3 | 4 | 90° | 5.0000 (Right Triangle) |
| 5 | 5 | 60° | 5.0000 (Equilateral) |
| 10 | 10 | 120° | 17.3205 |
| 7 | 10 | 45° | 7.0711 |
Frequently Asked Questions
Can the Law of Cosines be used with radians?
Yes, but you must ensure your calculator or software is set to radian mode. This web tool uses degrees as the default for user convenience.
What is the difference between SAS and SSS?
SAS (Side-Angle-Side) is when you know two sides and the angle between them. SSS (Side-Side-Side) is when you know all three side lengths but no angles.
What happens if I try to solve an impossible triangle?
If the sides do not follow the Triangle Inequality Theorem, the calculator will display "Invalid" or an error message because a triangle cannot be formed with those dimensions.
Is the Law of Cosines better than the Law of Sines?
Neither is "better," but the Law of Cosines is necessary when the Law of Sines lacks enough information to start (like in SSS cases or SAS cases where no angle-opposite-side pair is known).
Conclusion
Mastering the Law of Cosines opens up a world of geometric possibilities, allowing you to solve complex triangle problems with confidence. Whether you're navigating the seas, designing a building, or preparing for a math exam, our Law of Cosine Calculator provides the precision and speed you need. Bookmark this page to keep this powerful mathematical tool just a click away.