Go back to Calculators page

Law of Cosines Calculator

One method to find the lengths of sides and measures of angles in a triangle is through the law of sines. The law of cosines calculator uses this method to find the desired properties of a triangle quickly and efficiently.

What is the law of cosines?

Recall that the Pythagorean theorem enables one to find the lengths of sides of a right triangle, using the formula a^2 + b^2 = c^2, where a and b are sides and c is the hypotenuse of a right triangle. The Law of cosines is really a form of the Pythagorean theorem, modified for use of non-right triangles.  It describes the association between the lengths of the sides of any triangle.

For a triangle with sides a,b,c and corresponding angles  α, β and  γ, the law of cosines states that

a²  = b² + c² - (2bc)cos(α)

b² = a² + c² - (2ac)cos(β)

c² = a² + b² – (2ab)cos(γ)

Now we can use the law of cosines for a variety of things involving a triangle. First you can obtain the length of the third side of a triangle knowing the other two side lengths and the angle between them.

 

Just solve the above equations for a,b or c, depending on which side you need to obtain. This is simply done by taking the square root of the right side of the equation.

 

If you know two sides and the angle opposite one of them, you can obtain the length of the third side. Similarly, it is possible to find the angles of the triangle knowing all three sides solving the formula for the angles as follows:

α = arccos [(b² + c² - a²)/(2bc)]

β = arccos [(a² + c² - b²)/(2ac)]

γ = arccos [(a² + b² - c²)/(2ab)]

While these calculations can certainly be done manually with a little time and effort, the Law of cosines calculator does this for you quickly. Simply enter the information you know about the sides and or angles and let the calculator do the rest!