Omni Calculator logo

Law of Sines vs. Law of Cosines: What's the Difference?

In any triangle, there are two relationships between the lengths of the sides and the measures of the angles: the law of sines 🇺🇸 and the law of cosines 🇺🇸. In this article, we will:

  • Define the law of sines and cosines and state their formulae;
  • Explain when to use the law of sines vs. the law of cosines; and
  • Walk through two step-by-step examples.

By the end, you'll avoid the biggest trig sin, a.k.a choosing the wrong sine (or cosine).

The law of sines is a formula that establishes a relationship between the ratios of the sines of angles and the lengths of their opposite sides.

The law of sines allows you to find the measure of a side or an angle in any triangle. To do this, you need to know the measure of an angle, its opposite side, and another side or another angle. In short, a complete pair (side, angle) is required.

Illustration of the law of sines. Triangle with sides a, b, c and angles α, β, γ.

You can also write the law of sines formula as follows:

sinαa=sinβb=sinγc\frac{\sin \alpha}{a} = \frac{\sin \beta}{b} = \frac{\sin \gamma}{c}

💡 To know more about this subject, check out our other detailed article entitled: What is the law of sines (Sine Rule Explained).

The law of cosines is a formula for finding the measure of a side or an angle in any triangle.

The law of cosines generalizes the Pythagorean theorem 🇺🇸 to any triangle. It allows us to find the length of a side or the measure of an angle in any triangle. To do this, we need to know the lengths of two sides and the angle they form, or the lengths of all three sides of the triangle.

Illustration of the law of cosines. Triangle with sides a, b, c and angles α, β, γ.

The law of cosines can take the following forms:

a2=b2+c22bccosαb2=a2+c22accosβc2=a2+b22abcosγ\begin{align*} a^{2} &= b^{2} + c^{2} - 2bc \cos \alpha \\ b^{2} &= a^{2} + c^{2} - 2ac \cos \beta \\ c^{2} &= a^{2} + b^{2} - 2ab \cos \gamma \end{align*}

Generally, the law of cosines is used in two situations:

  • When the lengths of two sides and the angle they form in the triangle are known, the length of the third side can be found.
  • Or, when you know the lengths of the triangle's three sides, you can find the measure of an angle.

This table shows which law to use to determine the missing values in a given triangle.

Law of sines vs. law of cosines explanation chart

Known elements

No. of solutions

Law to use

Notes

1 side + 2 angles (ASA or AAS)

Unique solution

Law of sines

Find the third angle (180° rule), then apply the law of sines

2 sides + 1 included angle (SAS)

Unique solution

Law of cosines

Directly gives the missing side

2 sides + 1 opposite angle (SSA, ambiguous case)

Not unique (0, 1, or 2 solutions) if angle is opposite the longer side

Law of sines

The ambiguous case: may yield two possible triangles

2 sides + 1 opposite angle (SSA)

Unique solution if angle is opposite the shorter side

Law of sines

Only one valid triangle possible

All 3 sides (SSS)

Unique solution

Law of cosines

Use to find an angle first

All 3 angles (AAA)

No unique solution

Only defines the shape of the triangle, not its size

🙋 Interested in knowing more about the ambiguous case? Visit our article about it: Law of Sines: Ambiguous Case.

Example 1: The law of sines

Determine the missing sides and angles of the triangle with the given values: a=8ina = 8 \, \text{in}, α=40\alpha = 40^\circ, β=65\beta = 65^\circ.

  1. Find the third angle γ\gamma using the 180° rule:
γ=180αβ=1804065=75\begin{align*} \gamma &= 180^\circ - \alpha - \beta\\ &= 180^\circ - 40^\circ - 65^\circ = 75^\circ \end{align*}
  1. Apply the law of sines to find bb:
asinα=bsinβ8insin(40)=bsin(65)b=8in×sin(65)sin(40)b11.28in\begin{align*} \frac{a}{\sin\alpha} &= \frac{b}{\sin\beta}\\[1.3em] \frac{8 \, \text{in}}{\sin(40^\circ)} &= \frac{b}{\sin(65^\circ)}\\[1.3em] b &= \frac{8 \, \text{in} \times \sin(65^\circ)}{\sin(40^\circ)}\\[1.3em] b &\approx 11.28 \, \text{in} \end{align*}
  1. Apply the law of sines to find cc:
asinα=csinγ8insin(40)=csin(75)c=8in×sin(75)sin(40)c12.02in\begin{align*} \frac{a}{\sin\alpha} &= \frac{c}{\sin\gamma}\\[1.3em] \frac{8 \, \text{in}}{\sin(40^\circ)} &= \frac{c}{\sin(75^\circ)}\\[1.3em] c &= \frac{8 \, \text{in} \times \sin(75^\circ)}{\sin(40^\circ)}\\[1.3em] c &\approx 12.02 \, \text{in} \end{align*}

Example 2: The law of cosines

Determine the missing sides and angles of the triangle with the given values: α=40\alpha = 40^\circ, b=9inb = 9 \, \text{in}, c=11inc = 11 \, \text{in}.

  1. Apply the law of cosines to find aa:
a2=b2+c22bccos(α)=92+1122×9×11×cos(40)50.3a7.09in\begin{align*} a^{2} &= b^{2} + c^{2} - 2bc \cos(\alpha)\\ &= 9^{2} + 11^{2} - 2 \times 9 \times 11 \times \cos(40^\circ)\\ &\approx 50.3\\ a &\approx 7.09 \, \text{in} \end{align*}
  1. Apply the law of cosines to find β\beta:
b2=a2+c22accosβcos(β)=a2+c2b22ac=7.092+112922×7.09×110.579β54.64\begin{align*} b^{2} &= a^{2} + c^{2} - 2ac \cos \beta\\[1.3em] \cos(\beta) &= \frac{a^{2} + c^{2} - b^{2}}{2ac}\\[1.3em] &= \frac{7.09^{2} + 11^{2} - 9^{2}}{2 \times 7.09 \times 11}\\[1em] &\approx 0.579\\[1em] \beta &\approx 54.64^\circ \end{align*}
  1. Use the 180° rule to find γ\gamma:
γ=180αβ=1804054.6485.36\begin{align*} \gamma &= 180^\circ - \alpha - \beta\\ &= 180^\circ - 40^\circ - 54.64^\circ \approx 85.36^\circ \end{align*}

💡 Curious about trigonometry? Check out our right triangle calculator 🇺🇸!

The law of sines and the law of cosines are complementary tools used to solve triangles. The law of sines applies to angle-side pairs (ASA, AAS, or SSA), and the law of cosines applies to three-side pairs (SSS) or two-side pairs with an included angle (SAS). In practice, these two laws work together in fields such as geometry, navigation, astronomy, engineering, and surveying.

When viewing a vertex at an angle θ, sin(θ) is the ratio of the opposite side to the hypotenuse, while cos(θ) is the ratio of the adjacent side to the hypotenuse.

You can generally use the cosine rule when you have two sides and the included angle (SAS) or three sides and want to calculate an angle (SSS). To use the sine rule, you must know either two angles and one side (ASA) or two sides and one non-included angle (SSA).

The sine is always the measurement of the opposite side divided by the hypotenuse measurement. Since the hypotenuse is always the longest side, the number at the bottom of the ratio will always be greater than the number at the top.

This article was written by Claudia Herambourg and reviewed by Steven Wooding.