GEOMETRY CALCULATOR

Law of Cosines Calculator

Enter two triangle side lengths and the angle between them in degrees to find the opposite side, area, and perimeter.

Calculator

°
YOUR RESULTS
Side opposite included angle5
Triangle area
6 square units
Triangle perimeter
12

Page guide

Side opposite included angle and interpretation

The missing side lies opposite the entered included angle. Side and perimeter use your length unit; area uses that unit squared. The angle must define a nondegenerate triangle.

The formula

c² = a² + b² − 2ab cos C; area = ab sin C / 2.

Apply the cosine rule to the two known sides and their included angle. The implementation uses an equivalent half-angle expression for the missing side and the sine area formula for the same triangle.

Verified worked example

Two sides of 3 and 4 meeting at 90° give c = √(9 + 16) = 5. The area is 3 × 4 / 2 = 6 square units and the perimeter is 12.

How to use this calculator

  1. Enter the two known side lengths in the same unit.
  2. Enter their included angle in degrees, strictly between 0° and 180°.
  3. Read the opposite side, triangle area, and total perimeter.

Law of Cosines input conventions

The included angle sits between the two known sides. It is not the angle opposite either known side. These side-angle-side inputs define one nondegenerate triangle when the lengths are positive and the angle lies strictly between zero and 180 degrees. Unlike a right-triangle shortcut, the cosine rule works for acute and obtuse angles as well.

Interpreting side opposite included angle

The implementation evaluates an equivalent half-angle expression to reduce cancellation when the known sides are nearly equal and the included angle is small. A 90-degree angle eliminates the cosine term and reproduces the Pythagorean theorem. Keep both lengths in the same unit; the area uses that unit squared. Rounded measurements can still produce an approximate result even when the algebra is exact.

Assumptions & limitations

What this calculation assumes

  • The angle is between the two known sides, and both sides share one length unit.

What to keep in mind

  • Side-angle-side numerical triangles only; no ambiguous side-side-angle branch.

Common questions

Which angle should I enter?

Enter the angle formed by the first and second known sides at their shared vertex. If your diagram labels another angle, these inputs are not side-angle-side.

Can the angle be 180 degrees?

No. At zero or 180 degrees the points lie on a line and the triangle has no positive area. The supported angle excludes both endpoints.

Does this reduce to the Pythagorean theorem?

Yes. At an included angle of 90°, the cosine term vanishes, so the opposite side is the square root of the sum of the known sides’ squares.

Sources & further reading

Reviewed on