Law of Cosines Calculator
Solve triangles using the law of cosines: SAS and SSS cases with step-by-step solutions
Triangle Calculator
Triangle Solution
Sides
Angles
Triangle Properties
Example: Finding the Third Side (SAS)
Problem
In a triangle, two sides are 5 and 6 units, and the angle between them is 30°. Find the third side.
Solution
Given: a = 5, b = 6, γ = 30°
Using the law of cosines: c² = a² + b² - 2ab cos(γ)
c² = 5² + 6² - 2(5)(6) cos(30°)
c² = 25 + 36 - 60 × 0.866
c² = 61 - 51.96 = 9.04
c ≈ 3.01 units
Law of Cosines Formulas
Finding Sides
a² = b² + c² - 2bc cos(α)
b² = a² + c² - 2ac cos(β)
c² = a² + b² - 2ab cos(γ)
Finding Angles
α = arccos[(b² + c² - a²)/(2bc)]
β = arccos[(a² + c² - b²)/(2ac)]
γ = arccos[(a² + b² - c²)/(2ab)]
When to Use Law of Cosines
Triangle Types
Understanding the Law of Cosines
What is the Law of Cosines?
The law of cosines (also known as the cosine rule) relates the lengths of a triangle's sides to the cosine of one of its angles. It generalizes the Pythagorean theorem and can be applied to any triangle, not just right triangles.
Applications
- •Navigation and surveying
- •Engineering and construction
- •Physics and astronomy
- •Computer graphics and game development
Relationship to Pythagorean Theorem
When the angle γ = 90°, cos(90°) = 0, and the law of cosines becomes:
c² = a² + b² - 2ab × 0
c² = a² + b²
This is the Pythagorean theorem!
Historical Note
The law appeared in Euclid's Elements, though not in its modern form. The first explicit equation was presented by Persian mathematician d'Al-Kashi in the 15th century, and it was later popularized by French mathematician Viète.