TFT

Law of Cosines Calculator – Solve Triangles Using Cosine Rule

Solve triangles using the Law of Cosines with our free online calculator. Find missing sides and angles for SSS and SAS configurations with detailed step-by-step solutions.

Examples:

Understanding the Law of Cosines

The Law of Cosines generalizes the Pythagorean theorem to any triangle. For right triangles, it reduces to a² + b² = c². It relates the three sides of a triangle to the cosine of one of its angles.

Use the Law of Cosines when you know all three sides (SSS) or two sides and the included angle (SAS). It's the go-to formula when the Law of Sines doesn't apply.

The Law of Cosines Formula

a² = b² + c² - 2bc·cos(A)

Find side a

b² = a² + c² - 2ac·cos(B)

Find side b

c² = a² + b² - 2ab·cos(C)

Find side c

For finding angles, rearrange: cos(A) = (b² + c² - a²) / (2bc)

Worked Examples

Example 1: SSS Triangle (7, 5, 8)

Given: a=7, b=5, c=8
cos(A) = (25 + 64 - 49) / (2×5×8) = 40/80 = 0.5
A = arccos(0.5) = 60°
cos(B) = (49 + 64 - 25) / (2×7×8) = 88/112 ≈ 0.786
B = arccos(0.786) ≈ 38.21°
C = 180° - 60° - 38.21° ≈ 81.79°

Example 2: SAS Triangle

Given: b=10, ∠A=60°, c=8
a² = 100 + 64 - 2×10×8×cos(60°)
a² = 164 - 160×0.5 = 164 - 80 = 84
a = √84 ≈ 9.17
Area = ½ × 10 × 8 × sin(60°) ≈ 34.64

Example 3: Right Triangle Verification

Given: a=3, b=4, c=5 (Pythagorean triple)
cos(C) = (9 + 16 - 25) / (2×3×4) = 0/24 = 0
C = arccos(0) = 90° ✓
Confirms this is a right triangle!

Quick Fact

The Law of Cosines was stated in Euclid's Elements (around 300 BCE) in geometric form, though not using cosine. The modern trigonometric form was developed by Persian mathematician Al-Kashi in the 15th century. In France, it's still called "Al-Kashi's theorem."

Frequently Asked Questions

When should I use Law of Cosines vs Law of Sines?

Use Law of Cosines for SSS (three sides) or SAS (two sides + included angle). Use Law of Sines for ASA, AAS, or SSA. Law of Cosines always works but is more computation; Law of Sines is simpler when applicable.

How does this relate to Pythagorean theorem?

When C = 90°, cos(90°) = 0, so c² = a² + b² - 2ab×0 = a² + b². The Law of Cosines becomes the Pythagorean theorem for right triangles.

Can the Law of Cosines give ambiguous results?

No! Unlike the Law of Sines (which can have the ambiguous SSA case), the Law of Cosines always gives a unique answer for SSS and SAS triangles.

What if I get a negative cosine value?

Negative cosine means the angle is obtuse (greater than 90°). This is perfectly valid. arccos of a negative number gives an angle between 90° and 180°.

How do I know if three sides form a valid triangle?

Use the triangle inequality: the sum of any two sides must exceed the third side. If a + b ≤ c (or any similar combination), no triangle exists with those sides.

Other Free Tools

Law of Sines Calculator – Solve Triangles Using Sine Rule

Solve any triangle using the Law of Sines with our free online calculator. Find missing sides and angles for ASA, AAS, and SSA triangle configurations with step-by-step solutions.

Triangle Solver – Solve Any Triangle SSS SAS ASA AAS

Solve any triangle completely using SSS, SAS, ASA, or AAS methods with our free online triangle solver. Find all missing sides, angles, and area with step-by-step trigonometric solutions.

Triangle Angle Calculator – Find Missing Angles in a Triangle

Find any missing angle in a triangle with our free online angle calculator. Enter known angles or sides and instantly solve for the remaining angles using trigonometry rules.

Trig Function Calculator – Calculate Sin Cos Tan Online

Calculate any trigonometric function value including sin, cos, tan, csc, sec, and cot for any angle in degrees or radians with our free online trig calculator.

Inverse Trig Calculator – Find arcsin arccos arctan Online

Calculate inverse trigonometric functions including arcsin, arccos, and arctan with our free online inverse trig calculator. Get angle results in both degrees and radians.

Trig Identity Verifier – Verify Trigonometric Identities Online

Verify any trigonometric identity online with our free trig identity verifier. Simplifies both sides of an equation to check if the identity holds using fundamental trig rules.

Right Triangle Calculator – Solve Right Triangles Online

Solve any right triangle by entering two known values with our free online right triangle calculator. Find all sides, angles, area, and perimeter with clear step-by-step solutions.

Angle of Elevation & Depression Calculator – Solve Word Problems

Calculate the angle of elevation or depression with our free online solver. Enter height and distance to find the angle, or the angle to find missing dimensions – perfect for trig word problems.