Law of Cosines Calculator
Find the missing side of a triangle given two sides and their included angle.
Length of the first known side.
Length of the second known side.
The angle between sides ‘a’ and ‘b’, in degrees.
Select the unit of measurement for the sides.
Results
Triangle Visualization
What is a Law of Cosines Calculator?
A finding sides of a triangle using law of cosines calculator is a specialized tool designed to determine the length of an unknown side of any triangle when you know the lengths of the other two sides and the angle between them (a configuration known as Side-Angle-Side or SAS). The Law of Cosines is a fundamental theorem in trigonometry that extends the Pythagorean theorem to all triangles, not just right-angled ones.
This calculator is invaluable for students, engineers, architects, and anyone who needs to solve for triangle dimensions without the luxury of a 90-degree angle. By simply inputting the known values, our calculator instantly applies the Law of Cosines formula to provide the length of the missing side.
The Law of Cosines Formula and Explanation
The Law of Cosines relates the lengths of the sides of a triangle to the cosine of one of its angles. To find the length of a side ‘c’ when you know sides ‘a’ and ‘b’ and the angle ‘C’ (gamma, γ) opposite to side ‘c’, the formula is:
c² = a² + b² - 2ab * cos(C)
This powerful formula is the core of our finding sides of a triangle using law of cosines calculator. It calculates the square of the unknown side, and the final step is to take the square root of the result. To learn about solving triangles with other configurations, you might explore our Law of Sines Calculator.
Variables Table
| Variable | Meaning | Unit (Auto-Inferred) | Typical Range |
|---|---|---|---|
| a, b | Known lengths of two sides of the triangle. | cm, m, in, ft, etc. | Any positive number. |
| c | The unknown length of the third side, opposite Angle C. | Same as input units. | Calculated positive number. |
| C (γ) | The known angle included between sides ‘a’ and ‘b’. | Degrees | 0° to 180° |
Practical Examples
Example 1: Acute Angle
Imagine you have a triangular garden plot. You measure two sides to be 15 meters and 20 meters, and the angle between them is 60 degrees. You want to find the length of the third side for fencing.
- Input Side ‘a’: 15 m
- Input Side ‘b’: 20 m
- Input Angle ‘C’: 60°
- Result: Using the finding sides of a triangle using law of cosines calculator, the third side ‘c’ is calculated to be approximately 18.03 meters.
Example 2: Obtuse Angle
Consider a surveyor mapping a piece of land. They measure two sides from a corner point as 300 feet and 450 feet, with an obtuse angle of 110 degrees between them.
- Input Side ‘a’: 300 ft
- Input Side ‘b’: 450 ft
- Input Angle ‘C’: 110°
- Result: The calculator would determine the length of the third side ‘c’ to be approximately 615.51 feet. For complex land plots, a Triangle Area Calculator could also be useful.
How to Use This Law of Cosines Calculator
- Enter Side ‘a’: Input the length of the first known side in the designated field.
- Enter Side ‘b’: Input the length of the second known side.
- Enter Angle ‘C’: Provide the angle between sides ‘a’ and ‘b’, measured in degrees.
- Select Units: Choose the appropriate unit of measurement from the dropdown menu. This ensures your result is correctly labeled.
- Interpret Results: The calculator will instantly display the length of the unknown side ‘c’ in the results section, along with a visual representation and intermediate calculation values.
Key Factors That Affect Law of Cosines Calculations
- Angle Measurement: The accuracy of the resulting side length is highly dependent on the precision of the angle input. A small error in degrees can lead to a significant difference in the final length.
- Unit Consistency: All side lengths must be in the same unit. Our calculator simplifies this by applying a single unit choice to all sides.
- Side-Angle-Side (SAS) Case: The Law of Cosines is the correct tool specifically for the SAS case (two sides and the included angle). If you have a different configuration, such as two angles and a side (AAS/ASA), you should use the Law of Sines.
- Obtuse vs. Acute Angles: The cosine of an obtuse angle (greater than 90°) is negative. This correctly increases the length of the third side, a detail the calculator handles automatically.
- Rounding Precision: The calculator provides a precise result, but in practical applications, you may need to round the final answer to a specific number of decimal places.
- Triangle Inequality Theorem: For a valid triangle to be formed, the sum of the lengths of any two sides must be greater than the length of the third side. The calculator’s results will always adhere to this principle. You can explore this with a Triangle Inequality Theorem Calculator.
Frequently Asked Questions (FAQ)
Use the Law of Cosines when you know two sides and the angle between them (SAS) or when you know all three sides (SSS). The Law of Sines is used when you know two angles and one side (AAS or ASA) or two sides and a non-included angle (SSA). Our guide on trigonometric laws provides more detail.
Yes. If you input an angle of 90 degrees, the cosine of 90° is 0. The formula simplifies to c² = a² + b², which is the Pythagorean theorem.
An angle inside a triangle cannot be greater than 180 degrees. The calculator assumes a valid triangle geometry and will produce an error or nonsensical result for angles outside the 0-180 degree range.
The “unitless” option is for theoretical math problems or scenarios where the lengths are given as abstract numbers or ratios, without a physical unit of measurement attached.
This specific tool is a finding sides of a triangle using law of cosines calculator. However, the Law of Cosines formula can be rearranged to solve for an angle if all three sides are known (a feature found in a different type of calculator).
The units are primarily for labeling the input and output correctly. The mathematical calculation itself is independent of the unit, as long as the same unit is used for all sides.
This occurs when the angle ‘C’ is obtuse (greater than 90°). The cosine of an obtuse angle is negative, which makes this term negative. In the formula c² = a² + b² – 2ab*cos(C), subtracting this negative term becomes an addition, correctly resulting in a longer side ‘c’.
It’s used in navigation to find the distance between two points, in surveying to measure land boundaries, and in engineering and physics to resolve force vectors. You can read more on our applications of trigonometry page.
Related Tools and Internal Resources
Explore other useful geometry and trigonometry tools to complement your calculations:
- Law of Sines Calculator: Solve triangles when you have Angle-Side-Angle (ASA) or Angle-Angle-Side (AAS) information.
- Triangle Area Calculator: Find the area of a triangle using various formulas, including Heron’s formula.
- Pythagorean Theorem Calculator: A specialized tool for solving side lengths in right-angled triangles.
- Angle Conversion Calculator: Easily convert between degrees and radians for your calculations.