Geometry

Law of Cosines

Law of Cosines calculator. Free online Law of Cosines. Calculate law of cosines online — fast, accurate, mobile-friendly, no signup needed.

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

Derivation

  1. ├── 01Givena = 5, b = 7, C = 60
  2. ├── 02Formula√(t²+a²-2 × t × a × cos(n × π / 180))
  3. ├── 03Substitute√(t²+5²-2 × t × 5 × cos(n × π / 180))
  4. └── 04Compute c6.244998
Did you know?

Every calculator here runs 100% in your browser — nothing is sent to a server or stored in a database.

§01What is

Understanding the Law of Cosines

The Law of Cosines computes c from 3 inputs: a, b, angle c (°). Law of Cosines calculator.

Geometry is what turns raw measurements into useful answers about space — how much paint, how big a yard, how much material a project will need. Every craftsperson, architect, and DIYer reaches for these formulas regularly. The Law of Cosines sits in that toolkit — it law of Cosines calculator. Enter your numbers above and the result updates instantly; every step of the math is shown in the Derivation panel so you can see exactly how the answer was reached.

§02The Formula

How it’s calculated

√(t²+a²-2 × t × a × cos(n × π / 180))

Where

a
a
b
b
C
Angle C (°)
§03Practical Example

Step-by-step walkthrough

Scenario

Apply the formula to a realistic set of inputs: a = 5, b = 7, Angle C (°) = 60.

  1. 01Start by noting the input — a: 5.
  2. 02Start by noting the input — b: 7.
  3. 03Start by noting the input — Angle C (°): 60.
  4. 04Substitute these values into the formula: √(t²+a²-2 × t × a × cos(n × π / 180))
  5. 05Compute c: the calculator returns 6.245.
  6. 06Cross-check the answer by opening the Derivation panel above — every line of math is shown so you can follow the computation end-to-end.
§04Variants

Common Law of Cosines Problems

The formula gets rearranged depending on which variable you need. Here are the patterns you’ll run into in the real world — find the one that matches your problem and follow the worked steps.

01 · PATTERN

a halved

a = 2.5 (from 5)

Keep every other input at its default and halve the a. See how c responds.

  1. 01New a: 2.5
  2. 02Baseline c: 6.245
  3. 03New c: 6.1441
  4. 04c decreases by 1.6% → use this sensitivity to plan for real-world variation.
02 · PATTERN

a doubled

a = 10 (from 5)

Keep every other input at its default and double the a. See how c responds.

  1. 01New a: 10
  2. 02Baseline c: 6.245
  3. 03New c: 8.88819
  4. 04c increases by 42.3% → use this sensitivity to plan for real-world variation.
03 · PATTERN

b halved

b = 3.5 (from 7)

Keep every other input at its default and halve the b. See how c responds.

  1. 01New b: 3.5
  2. 02Baseline c: 6.245
  3. 03New c: 4.4441
  4. 04c decreases by 28.8% → use this sensitivity to plan for real-world variation.
04 · PATTERN

b doubled

b = 14 (from 7)

Keep every other input at its default and double the b. See how c responds.

  1. 01New b: 14
  2. 02Baseline c: 6.245
  3. 03New c: 12.2882
  4. 04c increases by 96.8% → use this sensitivity to plan for real-world variation.
§05FAQ

Frequently asked questions

Yes. The calculator implements the standard formula as documented and returns exact floating-point results. No approximations are used unless noted in the formula.
Your feedback

How useful was this calculator?

Your ratings stay in your browser — they help us learn which tools people actually rely on.

Rate it
Was this helpful?