Trigonometry · interactive lab

Law of cosines calculator (cosine rule)

This cosine rule calculator uses the law of cosines, c² = a² + b² − 2ab cos C, to find the third side of a triangle from two sides and the angle between them (SAS), or every angle from three sides (SSS). It substitutes your numbers step by step and draws the triangle to scale.

Law of cosines calculatorLIVE EXPLORATION
Drawn to scale · orange: what the cosine rule found

Your measurements

Side c is opposite angle C. To find a side, C must be the angle between sides a and b. Lengths use the same unit; angles are in degrees.

Why it works

c² = a² + b² − 2ab cos C
    A little question. A clearer picture.

    Law of cosines calculator: common questions

    Wondering about the why? Start here.

    When should I use the law of cosines?

    Use it when you know two sides and the angle between them (SAS) and want the third side, or when you know all three sides (SSS) and want an angle. If you know two angles and a side, use the law of sines instead.

    Open the law of sines calculator
    Is the cosine rule the same as the law of cosines?

    Yes. Cosine rule, cosine law, and law of cosines are three names for the same formula: c² = a² + b² − 2ab cos C. When C is 90°, cos C is 0 and the formula becomes the Pythagorean theorem.

    Read the law of cosines guide
    How do I find an angle from three sides?

    Rearrange the formula to cos C = (a² + b² − c²) / (2ab), then take the inverse cosine. For sides 7, 8, and 9: cos C = (49 + 64 − 81) / 112 = 32 / 112 = 0.2857. C = arccos(0.2857) = 73.398°.

    See more worked examples