Utinzo

Law of Cosines Calculator

Find missing sides or angles of any triangle using the Law of Cosines. Supports SSS (all sides known) and SAS (two sides + included angle) modes.

Side c
6.244998
Side a5
Side b7
Side c6.244998
Angle A43.897886°
Angle B76.102114°
Angle C60°
Area (Heron's)15.155445
Perimeter18.244998

Did this tool work for you?

AdSense336 × 280
AdSense336 × 280

How to use this calculator

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

The Law of Cosines generalizes the Pythagorean theorem to any triangle. Given three sides (SSS) it finds any angle; given two sides and the included angle (SAS) it finds the third side.

  1. 1

    Choose your mode: SAS (two sides and the angle between them) or SSS (all three sides).

  2. 2

    Enter side a, side b, and either angle C (SAS) or side c (SSS).

  3. 3

    The calculator returns the missing side or angles, plus the area and perimeter.

  4. 4

    Angles are in degrees; sides share the same unit.

AdSense · 728 × 90

Frequently asked questions

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

Use the Law of Cosines when you have SSS (all three sides) or SAS (two sides and the included angle). Use the Law of Sines when you have AAS or ASA configurations. The Law of Cosines is also preferred for SSA cases to avoid the "ambiguous case" ambiguity.

Does the Law of Cosines work for right triangles?

Yes. When angle C = 90°, cos(90°) = 0, so the formula reduces to c² = a² + b² — exactly the Pythagorean theorem. The Law of Cosines is a generalization valid for all triangles.

What is the triangle inequality?

For any valid triangle, each side must be less than the sum of the other two sides: a < b + c, b < a + c, c < a + b. If your three sides violate this rule, no real triangle exists and the calculator will report an error.

How is area calculated from three sides?

When all three sides are known, Heron's formula gives the area: s = (a+b+c)/2, then Area = √[s(s−a)(s−b)(s−c)]. This calculator uses that formula to display area in SSS mode.

About law of cosines calculator

Law of Cosines — solve any triangle from sides and angles

The formula and its derivation

The Law of Cosines states c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. It follows from dropping an altitude in a general triangle and applying the Pythagorean theorem to the two resulting right triangles. Because cosine can be negative (for obtuse angles), the formula naturally handles all triangle types — acute, right, and obtuse — without special cases.

SSS vs SAS: choosing the right mode

In SSS mode all three sides are known; the formula is rearranged as cos(C) = (a² + b² − c²) / (2ab) to recover each angle in turn. In SAS mode the included angle C and its two flanking sides a, b are known; the formula solves directly for c. Either way the remaining angles are then found using the same formula (or, once two angles are known, by subtraction from 180°).

Practical uses in navigation and surveying

Surveyors use the Law of Cosines constantly: given two measured distances from a baseline and the angle at the surveying instrument, they calculate the distance across a river, ravine, or building without crossing it. GPS systems and cellular towers use triangulation based on the same principle. In game development and computer graphics, the law determines the angle between two 3D vectors — a step in lighting and collision calculations.

Law of Cosines Calculator – Utinzo

Learn more from an authoritative source:

Wikipedia
Related tools

Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →

Law of Cosines Calculator – Free Math Tool | Utinzo