Skip to content
RK Calculator
Menu

Law of Cosines Calculator

Find a triangle's third side from two sides and the angle between them, or its angles from three sides, with the law of cosines.

Change the values and press Calculate to work out your own figures.

Third side (SAS)

Enter two sides and the angle between them.

About side bOpposite angle B.
About side cOpposite angle C.
About angle aOpposite side a.
About angles inDegrees or radians.
Result
Side a of the triangle
23.08757899
Type
acute scalene
Side a
23.08757899
Side b
25
Side c
15
Angle A
65° = 1.134464014 rad = 13π/36 (65° 0′ 0″)
Angle B
78.92610464° = 1.377520392 rad (78° 55′ 34″)
Angle C
36.07389536° = 0.6296082481 rad (36° 4′ 26″)
Area
169.9327101
Perimeter
63.08757899
Semiperimeter
31.5437895
Heights
hₐ = 14.72070416, h_b = 13.59461681, h_c = 22.65769468
Medians
mₐ = 17.08042517, m_b = 14.92541965, m_c = 22.86412368
Inradius
5.387200231
Circumradius
12.73716243
Vertices (A at the origin, B on the x-axis)
A (0, 0), B (15, 0), C (10.56545654, 22.65769468)
Centroid
(8.521818848, 7.552564892)
Incentre
(8.456210504, 5.387200231)
Circumcentre
(7.5, 10.29491655)

The triangle's side a is 23.08757899.

Show the working
  1. Two sides and the angle between them: the third side from the law of cosines, a² = b² + c² − 2bc cos A
  2. Area = √(s(s − a)(s − b)(s − c)) = 169.9327101

Angles (SSS)

Enter the three sides.

About side aOpposite angle A.
About side bOpposite angle B.
About side cOpposite angle C.
Result
Angle A of the triangle
48.1896851°
Type
acute scalene
Side a
7
Side b
8
Side c
9
Angle A
48.1896851° = 0.8410686706 rad (48° 11′ 23″)
Angle B
58.41186449° = 1.019479358 rad (58° 24′ 43″)
Angle C
73.3984504° = 1.281044625 rad (73° 23′ 54″)
Area
26.83281573
Perimeter
24
Semiperimeter
12
Heights
hₐ = 7.66651878, h_b = 6.708203932, h_c = 5.96284794
Medians
mₐ = 7.762087348, m_b = 7, m_c = 6.020797289
Inradius
2.236067977
Circumradius
4.695742753
Vertices (A at the origin, B on the x-axis)
A (0, 0), B (9, 0), C (5.333333333, 5.96284794)
Centroid
(4.777777778, 1.98761598)
Incentre
(5, 2.236067977)
Circumcentre
(4.5, 1.341640786)

The triangle's angle a is 48.1896851°.

Show the working
  1. Three sides: each angle from the law of cosines, cos A = (b² + c² − a²) ÷ 2bc
  2. Area = √(s(s − a)(s − b)(s − c)) = 26.83281573

How to use it

Enter two sides and the angle between them. Enter the three sides.

Enter the values you know (decimals, fractions, surds such as 2√5, or angles such as π/3 in radians). Show the working gives the rule used at each step.

Key facts

a² = b² + c² − 2bc cos A

A generalised Pythagoras

With A = 90°, cos A = 0 and the law of cosines becomes a² = b² + c².

Questions

What is side a with b = 25, c = 15 and A = 65°?

≈ 23.08757899.

When do I use it?

Two sides and the angle between them, or all three sides.

Formulas

a² = b² + c² − 2bc cos A

Sources

Limitations

  • Angles can be typed in degrees or radians; radians may be written with π (π/3, 2pi/3).

Formula version 0.1.0Reviewed