Law of Cosines


Instructions: Use this Law of Cosines calculator to fully solve a triangle, for two sides and one angle that you provide, showing all the steps. Please type in the required information in the forms box below.


Side 1 (Valid positive expression. Ex. 3, or 1/3, etc) =


Angle (choose degrees or radians) =


Side 2 (Valid positive expression. Ex. 3, or 1/3, etc) =

More on this this Law Of Cosines

This calculator allows to solve a triangle using the Law of Cosines. In order to give the calculator what it needs, you need to provide two sides and the angle between them.

Once valid information has been provided to get started, just click on "Calculate" and the calculation steps will be shown.

What is the Law of Cosines?

The Law of Cosines is a fundamental trigonometric identity used to find the lengths of sides or angles in any triangle, not just right triangles. It extends the Pythagorean theorem to all types of triangles by incorporating the cosine of one of its angles.

You can look at the Law of Cosines as a generalized Pythagoras' Theorem, which take precise its same form when the correponding angle is 90 degrees, because the cosine of 90 degrees is zero.

Understanding the Law of Cosines Formula

Law of Cosines Diagram

The Law of Cosines has three main formulas, or better said three different expression of the formula, each corresponding to one side of the triangle:

  • c2=a2+b22abcos(C)c^2 = a^2 + b^2 - 2ab \cos(C)
  • a2=b2+c22bccos(A)a^2 = b^2 + c^2 - 2bc \cos(A)
  • b2=a2+c22accos(B)b^2 = a^2 + c^2 - 2ac \cos(B)

Here, aa, bb, and cc are the sides of the triangle, and AA, BB, and CC are the opposite angles to these sides, respectively.

Notice that you may have seen a version of the Law of Cosines being like c2=a2+b2+2abcos(C)c^2 = a^2 + b^2 + 2ab \cos(C), but that is a kind of an unnecessary contraption for obtuse angles. It is really not necessary to break down the rule with different cases, when the sign of cos(C)cos(C) accounts perfectly for all the possible cases.

How to Use the Law of Cosines

Steps to Calculate a Side

Here are the steps to find the length of a side using the Law of Cosines:

  • Identify the known sides and angles in your triangle. You need two sides and the angle formed by those two sides.
  • Choose the formula that includes the side you want to find. The formula chosen will have the missing side on the left side
  • Substitute the known values into the formula.
  • Solve for the unknown side.

When to Use the Law of Cosines?

The Law of Cosines is particularly useful when:

  • You know two sides and the included angle (SAS).
  • You know all three sides and need to find an angle (SSS).
  • The triangle is not a right triangle, and you need to find a side or an angle.

Examples of Law of Cosines in Action

Law of Cosines Example

Here are some practical examples that you could solve:

  • Example 1: If a=5a = 5, b=6b = 6, and C=60C = 60^\circ, find cc.
  • Example 2: Given a=7a = 7, b=8b = 8, and c=9c = 9, find angle AA.

Proof of the Law of Cosines

The Law of Cosines can be derived from the Pythagorean theorem by considering a triangle with an altitude drawn from one of its vertices. It is more complex than this, but an sketch for it is:

  • Construct a right triangle within the original triangle.
  • Use the Pythagorean theorem on this smaller triangle.
  • Relate the cosine of the angle to the sides of the triangle.

Comparing Law of Cosines with Pythagorean Theorem

While the Pythagorean theorem applies only to right triangles, the Law of Cosines:

  • Works for all triangles.
  • Incorporates the cosine of an angle, making it more versatile.
  • Can be used to find angles as well as sides.

Using the Law of Cosines Calculator

Online calculators can simplify the process, especially our calculator that shows the steps of the process:

  • Enter the known values into the calculator.
  • Select the side or angle you wish to find.
  • The calculator will provide the result based on the Law of Cosines formula.
Law of Cosines in Physics

What are the Rules for the Law of Cosines?

The rules for the Law of Cosines include:

  • It applies to any triangle, not just right triangles. The case of right triangles is the simplest case for the Law of Cosines.
  • The cosine of an angle must be between -1 and 1.
  • When the angle is 90 degrees, the formula simplifies to the Pythagorean theorem, because the cosine part becomes 0.

Which Equation Represents the Law of Cosines?

There is not ONE equation that represent the Law of Cosine. The equation representing the Law of Cosines for side cc is:

c2=a2+b22abcos(C)c^2 = a^2 + b^2 - 2ab \cos(C)

One of the other hand, the equation representing the Law of Cosines for side bb is:

b2=a2+c22accos(B)b^2 = a^2 + c^2 - 2ac \cos(B)

and the equation representing the Law of Cosines for side aa is:

a2=b2+c22bccos(A)a^2 = b^2 + c^2 - 2bc \cos(A)

What is the Cosine Rule in Simple Terms?

In simple terms, the cosine rule states that the square of one side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of those sides and the cosine of the included angle.

How Does the Law of Cosines Help in Solving Triangles?

The Law of Cosines allows you to:

  • Find any side when you know two sides and the included angle, like in the case of this calculator.
  • Determine any angle when you know all three sides. Usually you solve for one side when using the Law of Cosine, but could definitely solve for the angle.
  • Solve for angles or sides in non-right triangles where the Pythagorean theorem does not apply. In fact, non-right triangles are the main use you will find for it.

Can the Law of Cosines be Used for Any Triangle?

Yes, the Law of Cosines can be used for any triangle, whether it's acute, right, or obtuse, making it a versatile tool in trigonometry. You could have symmetries or have it to be a scalene triangle, Law of Cosines always applies.

Sometimes, the Law of Cosines is not enough to compute fully a triangle, and it is perhaps needed to use the Law of Sines (think of the AAS triangle case).

What are the Three Formulas for the Law of Cosines?

The three formulas for the Law of Cosines are:

  • c2=a2+b22abcos(C)c^2 = a^2 + b^2 - 2ab \cos(C)
  • a2=b2+c22bccos(A)a^2 = b^2 + c^2 - 2bc \cos(A)
  • b2=a2+c22accos(B)b^2 = a^2 + c^2 - 2ac \cos(B)

Notice that these formulas are based on choosing any of the sides as the opposite side. This is slightly different when you are working with a right triangle.

Explore Further with Related Calculators

Understanding the Law of Cosines can be greatly enhanced by exploring related trigonometric concepts. For instance, if you're dealing with angles in your calculations, you might find the Double Angle Formula useful for simplifying expressions or solving equations involving angles.

Additionally, visualizing how cosine behaves over different angles can be achieved with our Cos Graph calculator, providing a graphical representation that can aid in understanding the function's periodicity and amplitude.

When working with triangles, knowing the sides and angles can often lead to more complex calculations. Our Triangle Calculator with two angles and one opposite side can help you solve for the remaining sides and angles, which is particularly useful when applying the Law of Cosines in real-world problems. Moreover, for a broader range of trigonometric calculations, our Trig Calculator offers a comprehensive suite of tools to handle various trigonometric identities and equations.

log in to your account

Don't have a membership account?
REGISTER

reset password

Back to
log in

sign up

Back to
log in