Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Math
  3. /Triangle Calculators
  4. /Law of Cosines Calculator

Law of Cosines Calculator

Last updated: March 15, 2026

Calculator

Results

Side c

7.211103

Angle A

73.8979

°

Angle B

46.1021

°

Area

20.7846

Perimeter

21.2111

Height to side c

5.764614

c²

52

Results

Side c

7.211103

Angle A

73.8979

°

Angle B

46.1021

°

Area

20.7846

Perimeter

21.2111

Height to side c

5.764614

c²

52

The Law of Cosines Calculator solves triangles when you know two sides and the included angle (SAS configuration). The Law of Cosines is one of the most versatile tools in trigonometry, generalizing the Pythagorean theorem to work with any triangle, not just right triangles. The fundamental formula is $$c^2 = a^2 + b^2 - 2ab\cos(C)$$, where $$C$$ is the angle between sides $$a$$ and $$b$$, and $$c$$ is the side opposite angle $$C$$.

This calculator takes sides $$a$$ and $$b$$ along with their included angle $$C$$, computes the opposite side $$c$$, then uses the Law of Cosines again to find the remaining two angles. The complete solution includes all three sides, all three angles, the area, and the perimeter. The area is computed using $$A = \frac{1}{2}ab\sin(C)$$, which follows naturally from the SAS input configuration.

The Law of Cosines is essential when the Law of Sines cannot be directly applied, particularly in SAS and SSS configurations. In the SAS case (this calculator), you know two sides and the angle between them. In the SSS case, you know all three sides and need to find the angles. Both situations require the Law of Cosines as the primary solving tool.

Practical applications are abundant. In navigation, the law determines the distance between two points when you know the distances from a reference point and the angle between the lines of sight. In physics, it calculates the resultant of two force vectors with a known angle between them. Surveyors use it when they can measure two distances and the angle between them but cannot directly measure the third distance.

The formula reveals elegant connections to the Pythagorean theorem. When $$C = 90°$$, $$\cos(90°) = 0$$, and the formula reduces to $$c^2 = a^2 + b^2$$. When $$C < 90°$$ (acute), the cosine term is positive, making $$c^2 < a^2 + b^2$$. When $$C > 90°$$ (obtuse), the cosine term is negative, making $$c^2 > a^2 + b^2$$. This provides a direct way to classify triangles by their angles.

Historically, the law was known in various forms to ancient mathematicians. Euclid proved special cases in the Elements (Propositions 12 and 13 of Book II). The general trigonometric form was developed by Al-Kashi in the 15th century, which is why the law is sometimes called Al-Kashi's theorem in some traditions.

Visual Analysis

How It Works

The Law of Cosines for the SAS case:

$$c^2 = a^2 + b^2 - 2ab\cos(C)$$

$$c = \sqrt{a^2 + b^2 - 2ab\cos(C)}$$

Once $$c$$ is known, find the remaining angles:

$$A = \arccos\left(\frac{b^2 + c^2 - a^2}{2bc}\right)$$

$$B = \arccos\left(\frac{a^2 + c^2 - b^2}{2ac}\right)$$

The area from two sides and included angle:

$$\text{Area} = \frac{1}{2} ab \sin(C)$$

Understanding Your Results

Side c is the distance opposite the given angle C, computed from the SAS configuration. Angles A and B are derived from the complete set of sides using the inverse cosine function. The three angles should sum to 180°. The area uses the efficient two-side-included-angle formula. The perimeter is the sum of all three sides. All length outputs use the same units as the inputs.

Worked Examples

SAS with 60° Included Angle

Inputs

a8
b6
angle C60

Results

side c7.2111
angle A73.8979
angle B46.1021
area20.7846
perimeter21.2111

c² = 64 + 36 - 96·cos(60°) = 100 - 48 = 52. c = sqrt(52) ≈ 7.211.

Obtuse Angle (120°)

Inputs

a5
b7
angle C120

Results

side c10.4403
angle A24.1793
angle B35.8207
area15.1554
perimeter22.4403

c² = 25 + 49 - 70·cos(120°) = 74 + 35 = 109. c ≈ 10.44. The obtuse angle produces a longer opposite side.

Frequently Asked Questions

The Law of Cosines relates the three sides and one angle of any triangle: c² = a² + b² - 2ab·cos(C). It generalizes the Pythagorean theorem, which is the special case when C = 90° (since cos(90°) = 0).

Use the Law of Cosines when you have SAS (two sides and the included angle) or SSS (three sides). Use the Law of Sines when you have AAS or ASA (two angles and a side). The Law of Cosines avoids the ambiguous case that can arise with the Law of Sines.

When C = 90°, cos(90°) = 0, so the formula simplifies to c² = a² + b², which is the Pythagorean theorem. The Law of Cosines is the general case; the Pythagorean theorem is the special case for right triangles.

No. Interior angles of a triangle must be between 0° and 180° (exclusive). If angle C approached 180°, the triangle would degenerate into a straight line. The calculator accepts angles between 0.01° and 179.99°.

Rearrange the Law of Cosines: C = arccos((a² + b² - c²)/(2ab)). Apply this formula three times with appropriate substitutions to find all three angles. Our Triangle Angle Calculator performs exactly this computation.

In any triangle, the longest side is always opposite the largest angle, and the shortest side is opposite the smallest angle. If two sides are equal, their opposite angles are also equal (isosceles triangle property).

Sources & Methodology

Euclid, Elements, Book II, Propositions 12-13 (c. 300 BCE); Al-Kashi, Key of Arithmetic (1427); Weisstein, Eric W., "Law of Cosines," MathWorld; Larson, Ron, Precalculus, 10th Edition
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

Triangle Calculator

Triangle Calculators

Right Triangle Calculator

Triangle Calculators

Equilateral Triangle Calculator

Triangle Calculators

Isosceles Triangle Calculator

Triangle Calculators

Old 30 60 90 Triangle Calculator

Triangle Calculators

Triangle Area Calculator

Triangle Calculators