Law of Cosines Calculator
MiniWebtool’s Law of Cosines Calculator solves triangles from SAS or SSS information. It derives missing sides or angles and shows the formula substitutions, with a diagram, area, perimeter, and triangle classification.
For Gemini, paste the copied question into the chat. You can also copy it below.Need help using this tool? Ask AI
View the question
Enter two sides and the angle between them (SAS), or all three sides (SSS), to solve the triangle with the steps.
About Law of Cosines Calculator
Welcome to our Law of Cosines Calculator, a powerful trigonometry tool for solving triangles. Whether you know two sides and the included angle (SAS) or all three sides (SSS), this calculator provides complete solutions with step-by-step explanations, interactive visualizations, and additional triangle properties like area and perimeter.
At a Glance
Law of Cosines Calculator solves a triangle from two sides and the included angle (SAS) or from all three sides (SSS). It returns the missing sides and angles, area, perimeter and triangle type, with worked steps and a diagram.
| Feature | What you get | Good for |
|---|---|---|
| SAS case | Enter sides a and b and the included angle C to find side c and angles A and B using c^2 = a^2 + b^2 - 2ab cos(C). | Triangles where two sides and the angle between them are known |
| SSS case | Enter all three sides to find the three angles. The inputs are checked against the triangle inequality (any two sides must add to more than the third). | Finding angles from measured side lengths |
| Degrees or radians | Pick the angle unit before you enter values, and results use the same unit. | Trigonometry classes that work in either unit |
| Extra results | Area, perimeter, and a classification of the triangle as acute, right or obtuse come with every solution. | Getting the full set of triangle properties in one run |
| Steps and diagram | Step-by-step formula substitutions are shown beside an interactive SVG triangle drawing. | Checking each calculation and picturing the triangle |
What is the Law of Cosines?
The Law of Cosines (also called the Cosine Rule) is a fundamental theorem in trigonometry that relates the lengths of the sides of any triangle to the cosine of one of its angles. It is a generalization of the Pythagorean theorem and works for all triangles, not just right triangles.
Where $a$, $b$, and $c$ are the lengths of the sides, and $C$ is the angle opposite side $c$. The formula can be rearranged to find any side or angle:
To find an angle when all sides are known:
Understanding Triangle Cases
When you know two sides and the angle between them (the included angle).
- Given: Sides $a$ and $b$, Angle $C$
- Find: Side $c$, Angles $A$ and $B$
- Method: Use $c^2 = a^2 + b^2 - 2ab\cos(C)$
When you know all three sides of the triangle.
- Given: Sides $a$, $b$, and $c$
- Find: Angles $A$, $B$, and $C$
- Requirement: Triangle inequality must hold
How to Use This Calculator
- Select the case type: Choose SAS if you have two sides and the included angle, or SSS if you have all three sides.
- Choose angle unit: Select degrees or radians based on your input data.
- Enter your values:
- SAS: Enter side a, side b, and angle C (the angle between them)
- SSS: Enter all three sides a, b, and c
- Click Calculate: Get the complete triangle solution with all sides, angles, area, and perimeter.
- Review the solution: Examine the step-by-step calculation and interactive triangle visualization.
Applications of the Law of Cosines
Law of Cosines vs Pythagorean Theorem
The Law of Cosines is a generalization of the Pythagorean theorem. When angle $C = 90°$, we have $\cos(90°) = 0$, so the formula simplifies to:
This is exactly the Pythagorean theorem! The Law of Cosines extends this relationship to work with any triangle, not just right triangles.
Triangle Inequality Theorem
For three lengths to form a valid triangle, they must satisfy the Triangle Inequality Theorem: the sum of any two sides must be greater than the third side.
- $a + b > c$
- $a + c > b$
- $b + c > a$
Our calculator automatically validates SSS inputs against this theorem.
Classifying Triangles
The Law of Cosines can help determine the type of triangle:
- Acute triangle: If $c^2 < a^2 + b^2$ (all angles less than 90°)
- Right triangle: If $c^2 = a^2 + b^2$ (one angle is exactly 90°)
- Obtuse triangle: If $c^2 > a^2 + b^2$ (one angle greater than 90°)
Law of Cosines vs Law of Sines
Both laws are essential for solving triangles, but they apply to different situations:
- Law of Cosines: Best for SAS and SSS cases
- Law of Sines: Best for ASA, AAS, and SSA (ambiguous) cases
- The Law of Cosines is more computationally stable for obtuse angles
- Together, these laws can solve any triangle given sufficient information
Frequently Asked Questions
What is 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. The formula is $c^2 = a^2 + b^2 - 2ab\cos(C)$, where $a$, $b$, and $c$ are the sides of the triangle, and $C$ is the angle opposite side $c$. It generalizes the Pythagorean theorem to all triangles.
When should I use the Law of Cosines vs Law of Sines?
Use the Law of Cosines for SAS (Side-Angle-Side) and SSS (Side-Side-Side) cases. Use the Law of Sines for ASA (Angle-Side-Angle), AAS (Angle-Angle-Side), and SSA (Side-Side-Angle) cases. The Law of Cosines is more computationally stable for obtuse angles.
What is the SAS case in triangle solving?
SAS (Side-Angle-Side) is when you know two sides of a triangle and the angle between them (the included angle). Using the Law of Cosines, you can find the third side, and then calculate the remaining angles.
What is the SSS case in triangle solving?
SSS (Side-Side-Side) is when you know all three sides of a triangle. Using the Law of Cosines rearranged to solve for angles, you can find all three angles. The triangle must satisfy the triangle inequality theorem.
How do I know if three sides can form a valid triangle?
Three sides form a valid triangle if they satisfy the Triangle Inequality Theorem: the sum of any two sides must be greater than the third side. This means $a + b > c$, $a + c > b$, and $b + c > a$ must all be true.
How is the Law of Cosines related to the Pythagorean theorem?
The Law of Cosines is a generalization of the Pythagorean theorem. When angle $C$ is 90°, $\cos(90°) = 0$, so the formula $c^2 = a^2 + b^2 - 2ab\cos(C)$ reduces to $c^2 = a^2 + b^2$, which is the Pythagorean theorem.
Additional Resources
Reference this content, page, or tool as:
"Law of Cosines Calculator" at https://MiniWebtool.com/law-of-cosines-calculator/ from MiniWebtool, https://MiniWebtool.com/
by miniwebtool team. Updated: Jan 19, 2026
Chat with your favorite AI
For Gemini, paste the copied question into the chat. You can also copy it below.
View the question
Trigonometry Calculators:
- Arccos (Inverse Cosine) Calculator
- Arcsin Calculator
- Arctan2 Calculator
- Arctan Calculator
- Cosine Calculator
- Cosecant/Secant/Cotangent Calculator
- Decimal Degrees to DMS Converter
- DMS to Decimal Degrees Converter
- Hyperbolic Functions Calculator
- Interactive Unit Circle Visualizer
- Law of Cosines Calculator
- Law of Sines Calculator
- Right Triangle Calculator
- Sine Calculator
- Tangent Calculator
- Trigonometric Function Grapher
- Trigonometric Identities Calculator