Math

Law of Cosines Calculator

Solve triangles using the Law of Cosines. Find the third side and area from two sides and the included angle.

CALCULATOR

Enter your numbers

Instant results
6.2450
Side c
15.1554
Area
Given: a = 5, b = 7, C = 60°
cos(C) = cos(60°) = 0.500000
c² = a² + b² - 2ab·cos(C) = 5² + 7² - 2×5×7×0.500000 = 39.000000
c = √39.000000 = 6.2450
Area = ½ × a × b × sin(C) = ½ × 5 × 7 × sin(60°) = 15.1554

THE NUMORIX GUIDE

How to use the Law of Cosines Calculator

Last reviewed September 14, 2026

What this calculator does

Convert angle C to radians and use c^2=a^2+b^2-2ab*cos(C), then calculate area = 0.

Formula and method

Convert angle C to radians and use c^2=a^2+b^2-2ab*cos(C), then calculate area = 0.5*a*b*sin(C). This is the SAS form of the law of cosines.

Variables and inputs

Side a defaults to 5, side b to 7, and included angle C to 60 degrees. Inputs should describe two sides and their included angle.

Worked example

For a=5,b=7,C=60 degrees: cos(C)=0.5; c^2=25+49-2*5*7*0.5=39; c=sqrt(39)=6.2450; area=0.5*5*7*sin60=15.1554 square units.

How to interpret the result

The law of cosines generalizes the Pythagorean theorem to non-right triangles; when C=90 degrees, the cosine term vanishes.

Common mistakes to avoid

Use the included angle between a and b, and square c only after evaluating the complete right side. Keep degree input distinct from radian calculation.

Assumptions and limitations

The UI exposes only the SAS side-and-angle form, not the inverse form for finding an angle. Invalid side/angle combinations can throw an error.

Practical use and checks

The Law of Cosines Calculator finds the third side and included-angle area from side a, side b, and angle C. Enter a = 5, b = 7, and C = 60 degrees as a check; c squared is 25 + 49 - 2(5)(7)cos(60), or 39, so c should be about 6.2450. The area should be one-half times 5 times 7 times sin(60), about 15.1554 square units. For C = 90 degrees, the formula reduces to the Pythagorean theorem. Use this method when two sides and their included angle are known, and make sure the angle is between those two sides rather than opposite the unknown side. The angle field is in degrees, while the trigonometric calculation uses radians internally. A side or angle set that violates triangle geometry can make c squared negative or produce a result that is not meaningful; the engine throws for the negative case but cannot prove every measurement is physically sensible. Rounding is more consequential when the included angle is close to 0 or 180 degrees. The result describes an ideal planar triangle and does not include thickness, surveying uncertainty, or a different angle convention. Check the returned side against the triangle inequality before using it in a layout or material estimate.

Sources and references

COMMON QUESTIONS

Frequently asked questions

Which angle should I enter?

Enter the angle between the two supplied sides a and b; it is the angle opposite the unknown side c.

Why is sine used for area?

The area of two sides with included angle C is one-half*a*b*sin(C), even when the triangle is not right.