Geometry

Law of Cosines Calculator

Find a triangle’s third side from two sides and the included angle.

Use consistent dimensionsArea and volume units explained below
Geometry desk
Geometry desk

Match each dimension to the shape and keep units consistent.

See the method

Set the dimensions

Runs on your device

Your measurement

Your result

Let’s calculate.

Use the Calculate button to see your result.

Review the method below for assumptions and conventions.

How to use this tool

  1. Enter the two known side lengths in metres.
  2. Enter the angle between those two sides in degrees, strictly between 0 and 180.
  3. Calculate the opposite side, triangle area and perimeter.

Input reference and sample values

Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.

InputFormat and unitsSample
First sideNumeric value. Unit: m. Must be greater than zero.3
Second sideNumeric value. Unit: m. Must be greater than zero.4
Included angleNumeric value. Unit: degrees. Minimum: 0.000001. Maximum: 179.999999.90

Result for these sample inputs

5 m
Included angle (degrees)
90
Triangle area (m²)
6
Perimeter (m)
12

Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.

The method, explained

c = √[(a − b)² + 4ab sin²(C/2)], equivalent to c² = a² + b² − 2ab cos C. The half-angle form avoids subtracting nearly equal terms for small angles.

A WORKED EXAMPLE

Sides 3 m and 4 m enclosing 90° give the opposite side 5 m, area 6 m² and perimeter 12 m.

What to keep in mind

This is the side-angle-side case; the angle must lie between the entered sides. It does not solve a triangle from three sides or from a non-included angle. Very small angles remain sensitive to measurement precision.

Common questions

Is the angle entered in radians?

No. Enter degrees; a right angle is 90.

Can the answer be zero for two equal sides?

Not for a positive included angle. The stable half-angle calculation preserves a small positive third side.

Methodology maintained by ClarityKit. How these tools are built and checked.