Category

Law of Cosines Calculator — Solve Triangles with SAS or SSS (Metric & Imperial)

Solve any triangle using the law of cosines: a²=b²+c²−2bc·cos(α). Find the missing side (SAS mode) or all angles (SSS mode). Calculates area, perimeter, and circumradius. Supports metric (cm, m, km) and US customary (in, ft, yd) units.

0 calculations

Parameters

cm
°
cm
cm
cm
cm

Enter Parameters

Fill in the form on the left to solve the triangle.

Law of Cosines Formula

The law of cosines (also known as the cosine rule or cosine formula) is a fundamental formula in trigonometry that relates the lengths of the sides of a triangle to the cosine of one of its angles. For a triangle with sides a, b, c and opposite angles α, β, γ respectively:

  • a² = b² + c² − 2bc · cos(α)
  • b² = a² + c² − 2ac · cos(β)
  • c² = a² + b² − 2ab · cos(γ)

What is the Law of Cosines?

The law of cosines generalises the Pythagorean theorem. When angle α equals 90°, cos(90°) = 0 and the formula reduces to a² = b² + c², which is exactly the Pythagorean theorem. This means the law of cosines applies to all triangles — right, acute, and obtuse — making it far more versatile.

The formula appeared in Euclid's Elements in geometric form. The modern cosine-based version was developed later as trigonometry matured. Today it is an essential tool in geometry, physics, engineering, and navigation.

Applications of the Law of Cosines

The law of cosines is used whenever you need to find:

  • The third side of a triangle when two sides and the included angle are known (SAS case).
  • All three angles of a triangle when all three sides are known (SSS case).
  • Distances in navigation, surveying, and cartography.
  • Force resultants in physics (vector addition).
  • 3D computer graphics and game development (collision detection, angle calculations).

How to Use the Law of Cosines Calculator

This calculator supports two modes:

  1. SAS (Side-Angle-Side) — Enter sides b and c and the included angle α. The calculator finds side a and the remaining angles β and γ.
  2. SSS (Side-Side-Side) — Enter all three sides a, b, and c. The calculator finds all three angles α, β, and γ.

Both metric (cm, m, km) and US customary (in, ft, yd) unit systems are supported. Select your preferred unit before entering values.

Law of Cosines — SSS Example

Suppose a triangle has sides a = 5 cm, b = 6 cm, c = 7 cm. Find all angles.

Step 1 — Find α:
cos(α) = (b² + c² − a²) / (2bc) = (36 + 49 − 25) / (2 · 6 · 7) = 60 / 84 ≈ 0.7143
α = arccos(0.7143) ≈ 44.42°

Step 2 — Find β:
cos(β) = (a² + c² − b²) / (2ac) = (25 + 49 − 36) / (2 · 5 · 7) = 38 / 70 ≈ 0.5429
β = arccos(0.5429) ≈ 57.12°

Step 3 — Find γ:
γ = 180° − 44.42° − 57.12° = 78.46°

You can verify: all three angles sum to 180°. ✓

FAQs

When should I use the law of cosines instead of the law of sines?
Use the law of cosines when you know two sides and the included angle (SAS) or all three sides (SSS). Use the law of sines for AAS and ASA cases.

Can the law of cosines be used for right triangles?
Yes. For a 90° angle, cos(90°) = 0, so the formula simplifies to the Pythagorean theorem.

What is the circumradius?
The circumradius R is the radius of the circle that passes through all three vertices of the triangle. It is calculated as R = a / (2 · sin(α)).

What units can I use?
The calculator supports metric units (cm, m, km) and US customary units (in, ft, yd). Angles are always entered in degrees.

Calculation History

Loading...