Law of Cosines Calculator
The Law of Cosines Calculator solves any triangle given three sides (SSS) or two sides and the included angle (SAS). Enter your known values to instantly find all missing sides and angles using the cosine rule, with step-by-step derivations.
How to Use the Law of Cosines Calculator
Interactive calculator available after JavaScript loads.
Loading calculator...
Math & Finance Experts — Verified Formulas, Peer-Reviewed Sources, Expert Analysis
Looking for a deeper explanation?
Read our comprehensive, peer-reviewed educational article in our Blog to learn the underlying math, formulas, and step-by-step examples.
Mathematical Formula & Logic
Step-by-Step Worked Calculation
Scenario: Example: SAS Triangle with a=5, b=7, C=60°
Find side c and angles A and B given two sides and the included angle.
Step 1: Apply law of cosines: c² = a² + b² - 2ab·cos(C).
Step 2: Substitute: c² = 25 + 49 - 2(5)(7)cos(60°) = 74 - 70(0.5) = 74 - 35 = 39.
Step 3: c = √39 ≈ 6.245.
Step 4: Find angle A using: cos(A) = (b² + c² - a²)/(2bc) = (49 + 39 - 25)/(2·7·6.245) = 63/87.43 ≈ 0.7206.
Step 5: A = arccos(0.7206) ≈ 43.9°, and B = 180° - 60° - 43.9° = 76.1°.
How to Use the Law of Cosines Calculator
- 1. Select the known configuration: SSS (three sides) or SAS (two sides + included angle).
- 2. Enter the known side lengths and/or angle.
- 3. The calculator computes all missing sides and angles.
- 4. Review the step-by-step solution and the law of cosines formula used.
What Is a Law of Cosines Calculator?
Law of Cosines Calculator is a mathematical computation tool that helps you solve any triangle using the Law of Cosines. Find missing sides or angles given SAS or SSS configurations with step-by-step results and formulas. It applies established mathematical principles to deliver accurate results, often showing the underlying formula and step-by-step working so you can understand the computation process.
Why This Calculation Matters
Mathematical calculations form the foundation of science, engineering, finance, and everyday problem-solving. Law of Cosines Calculator helps you work through calculations accurately and efficiently, reducing the risk of manual arithmetic errors. Whether you are a student learning concepts, a professional verifying work, or anyone needing quick and reliable math results, this tool ensures precision and saves time.
Historical Background
Mathematics has evolved over thousands of years, from ancient Babylonian clay tablets and Egyptian papyri to Greek formal proofs by Euclid and Archimedes. The development of algebra by Persian mathematician al-Khwarizmi in the 9th century and the invention of calculus by Newton and Leibniz in the 17th century laid the groundwork for modern computation. Law of Cosines Calculator continues this tradition by making mathematical operations accessible through digital technology.
Frequently Asked Questions
Complete indexable directory of answers (13 questions)
What is the law of cosines?
The law of cosines states that c² = a² + b² - 2ab·cos(C) for any triangle. It generalizes the Pythagorean theorem to non-right triangles. When C = 90°, cos(90°) = 0, and the formula reduces to c² = a² + b².
When should I use the law of cosines?
Use the law of cosines when you know: (1) three sides (SSS) and need to find angles, or (2) two sides and the included angle (SAS) and need to find the third side. It works for any triangle, not just right triangles.
What is the difference between law of cosines and law of sines?
The law of cosines relates three sides and one angle (c² = a² + b² - 2ab·cos(C)). The law of sines relates sides to their opposite angles (a/sin(A) = b/sin(B)). Use law of cosines for SSS and SAS; use law of sines for ASA and AAS.
How do I find an angle using the law of cosines?
Rearrange the formula: cos(C) = (a² + b² - c²)/(2ab). Calculate the right side, then take arccos to find angle C. This is how you solve SSS triangles.
Does the law of cosines work for right triangles?
Yes. When C = 90°, cos(90°) = 0, so the formula becomes c² = a² + b² - 0 = a² + b², which is the Pythagorean theorem. The law of cosines is a generalization of the Pythagorean theorem.
What is the ambiguous case?
The ambiguous case (SSA) occurs with the law of sines, not the law of cosines. However, the law of cosines can be used to resolve SSA ambiguity: set up the quadratic equation and check how many positive solutions exist.
How do I solve an SSS triangle?
For SSS, use the law of cosines to find the largest angle first (opposite the longest side). Then use the law of cosines or law of sines to find the remaining angles. The angles should sum to 180°.
How do I solve a SAS triangle?
For SAS, use the law of cosines to find the third side: c² = a² + b² - 2ab·cos(C). Then use the law of sines or law of cosines to find the remaining angles.
Can the law of cosines find the area of a triangle?
Indirectly, yes. After finding all sides and angles, you can use the formula Area = (1/2)ab·sin(C). The law of cosines helps you find the needed values first.
What are common mistakes when using the law of cosines?
Common mistakes include: (1) using the wrong angle with the wrong sides (angle must be between the two known sides in SAS), (2) forgetting to take the square root after computing c², (3) using degrees when the calculator expects radians.
What mathematical formula does the Law of Cosines Calculator use?
The Law of Cosines Calculator uses standard mathematical formulas validated against authoritative references. The specific formula is displayed in the calculator interface with a detailed explanation of each variable.
How can I verify the Law of Cosines Calculator results manually?
Each calculator includes a step-by-step worked example showing exactly how the formula is applied. You can follow these steps with pen and paper to verify any result.
What types of inputs does the Law of Cosines Calculator accept?
The Law of Cosines Calculator accepts numeric inputs including integers and decimals. Invalid inputs (letters, special characters) are rejected with clear error messages.