# Law of Cosines Calculator > Solve triangles using the law of cosines: c² = a² + b² - 2ab·cos(C) **Category:** Math **Keywords:** law of cosines, cosine rule, triangle, geometry, trigonometry, angle, side, SSS, SAS **URL:** https://complete.tools/law-of-cosines-calculator ## How it calculates The Law of Cosines is expressed by the formula: c² = a² + b² - 2ab × cos(C), where 'c' is the length of the side opposite angle C, and 'a' and 'b' are the lengths of the other two sides. Angle C is measured in degrees or radians. To calculate a missing side, you can rearrange the formula as follows: c = √(a² + b² - 2ab × cos(C)). This formula allows for the calculation of side lengths when two sides and the included angle are known. Conversely, if all three sides are known, the formula can be rearranged to find the angles using the cosine inverse function: C = cos⁻¹((a² + b² - c²) ÷ (2ab)). This relationship allows for flexibility in solving various types of triangle configurations. ## Who should use this Surveyors calculating land boundaries that require precise angles and distances, mechanical engineers designing components that must fit together accurately, and architects determining structural integrity based on triangular supports are specific scenarios where this tool would be beneficial. ## Worked examples Example 1: A mechanical engineer needs to find the length of the third side of a triangle where sides a = 7 m, b = 5 m, and the angle C = 60°. Using the formula: c² = a² + b² - 2ab × cos(C), we calculate c² = 7² + 5² - 2 × 7 × 5 × cos(60°). This simplifies to c² = 49 + 25 - 35 = 39. Thus, c = √39 ≈ 6.24 m. Example 2: An architect has a triangular support with sides a = 10 ft, b = 14 ft, and c = 18 ft. To find angle C, we use: C = cos⁻¹((a² + b² - c²) ÷ (2ab)). Plugging in the values gives C = cos⁻¹((10² + 14² - 18²) ÷ (2 × 10 × 14)) = cos⁻¹((100 + 196 - 324) ÷ 280) = cos⁻¹(-28 ÷ 280) = cos⁻¹(-0.1) ≈ 95.74°. ## Limitations This tool has specific limitations, including precision limits due to floating-point arithmetic which can affect very small or very large values. Edge cases such as obtuse triangles may yield ambiguous results when using only two sides and an angle. Additionally, the assumption that angles are measured in either degrees or radians must be adhered to, as mixing units can lead to inaccuracies. The formula also assumes a planar triangle; it is not applicable for non-Euclidean geometries or in three-dimensional space. ## FAQs **Q:** Can the Law of Cosines be applied to right triangles? **A:** Yes, the Law of Cosines simplifies to the Pythagorean theorem for right triangles, as the cosine of 90° is zero. **Q:** How does the Law of Cosines relate to triangle congruence? **A:** The Law of Cosines can help establish triangle congruence by confirming that two sides and the included angle (SAS) match another triangle's dimensions. **Q:** What is the difference between the Law of Cosines and the Law of Sines? **A:** The Law of Cosines is used when two sides and the included angle or all three sides are known, while the Law of Sines is used when two angles and one side (ASA) or two sides and a non-included angle (SSA) are known. **Q:** How do rounding errors affect calculations in this tool? **A:** Rounding errors can occur as results are derived from trigonometric functions and square roots, possibly leading to slight inaccuracies, especially in precision-critical applications. --- *Generated from [complete.tools/law-of-cosines-calculator](https://complete.tools/law-of-cosines-calculator)*