
In this page, we will consider a triangle ABC with sides a, b, and c. The triangle is labeled so that side a is opposite angle A, side b is opposite angle B, and side c is opposite angle C.
Law of Cosines 
The Law of Cosines is most useful when you know two sides a, b, and the included angle, C:

Law of Sines 
The Law of Sines is most useful when you know a side, a, and the angle, A, opposite it. Then for every other side you can find its opposite angle, and for every other angle, you can find its opposite side.

If you know any three facts about triangle ABC  lengths of sides or measures of angles  then you can use one of these laws to find the lengths of all sides and measures of all angles.
These cases boil down to four cases:
AAS  Any two angles, and one side (Law of Sines)
SAS  Side, included Angle, and Side (Law of Cosines)
SSA  Two sides, and a nonincluded Angle (Law of Sines) — this might have two solutions!
SSS  All three sides (Law of Cosines)
Here is a breakdown of these four cases:
If you know any two angles and any side, then you really know all three angles, so you have the "AAS" case  Angle, Angle, Side. Let's say you know angles A, B, and C, and the side you know is side a. From the Law of Sines,
b/sin(B) = a/sin(A)
b = a sin(B) / sin(A)
example
a = 11, A=110°, B=20�, C=50�
From the Law of Sines,
b = a sin(B) / sin(A) = 11 * sin(20) / sin(110) = 4.00367
c = a sin(C) / sin(A) = 11 * sin(50) / sin(110) = 8.96728
The Law of Cosines gives the length of the side opposite an angle if you know the lengths of the other two sides. This is the SAS case  you know the Side, Angle, and Side.
c² = a² + b²  2ab cos(C)
example
Suppose you know a=58, b=120, and C=45�
The third side, c, is found using the law of cosines: c² = a² + b²  2 a b cos(C)
58² + 120²  2 * 58 * 120 * cos(45) = 7921.074, sqrt(7921.074) = 89.0004.Now that we know both side c and angle C we can use the Law of Sines to find the other two angles.
This gives us:sin(A) = (a/c) sin(C), and
sin(B) = (b/c) sin(C)Now, watch out! It's possible that the largest angle of a triangle may be obtuse or acute, and you can't tell from the sine of an angle which it is, so here's a word to the wise: find the smaller angle first, knowing it's acute.
So we'll use the Law of Sines to find the smaller angle A first, using
sin(A) = (a/c) sin(C). Plugging in the values we know,
sin(A) = (58 / 89.0004) sin(45) = 0.46081, so A = 27.43932
Now, finding angle B is easy: B = 180  C  A, so B = 107.56068
The Law of Sines is a/(sin A) = b/(sin B) = c/(sin C) = the diameter of the circumscribed circle. (proof)
If you know the length of two sides and an angle other than the angle between those sides, then the Law of Sines can be used. This is the "SSA" case  Side, Side, Angle. Assuming you know the lengths of sides a and b, and angle A,
a/sin(A) = b/sin(B)
sin(B) = (b/a) sin(A)
If a < b, and sin(B) = (b/a) sin(A) is between 0 and 1, then two different angles, B, can satisfy this equation: one is acute, the other is obtuse, and these two angles are supplementary.
The two solutions of an SSA triangle
Here's an SSA triangle. Sides a (red) and b (green) are given, along with the nonincluded angle A. The conditions are right for two solutions — red shorter than green, and A small enough.
The second diagram, to the right, shows the circumcircle of the triangle formed by the first solution, where the red line is CB. From the Law of Sines, we know the diameter of the circumcircle is a/sin(A) = b/sin(B), etc.
So what about the second solution, where the red line is CD? In both solutions, side a has the same length (it was given to us, after all), and angle A is fixed as well, so a/sin(A) has the same value for both solutions.
This means the circumcircle of triangle ADC has the same diameter as the circumcircle of triangle ABC.
Now, let's think about the converse: Suppose we draw two intersecting circles with the same diameter, and then we draw line AC connecting the circles' points of intersection. Then we draw any other line through point A that intersects both circles at points D and B. Now, by the Inscribed Angle Property, an inscribed angle, A, intercepts an arc whose measure is 2A. So the measure of arc CD in one circle equals the measure of arc CB in the other circle. Since the circles have the same diameter, the chords CD and CB also have the same length.
example
a=5, b=11, A=25�
We know side a and opposite angle A so we can use the Law of Sines to find angle B: sin(B) = (b/a) sin(A)
Plugging in the numbers gives us sin(B) = (11 / 5) sin(25) = 0.92976.
Watch out! Since there are two different measures of angles B with the same sine, there may be two solutions to this problem.
This can happen if side b is longer than side a, and sin(B), as calculated above, is between 0 and 1.
In this case, since side b is indeed longer than side a, there are TWO possible angles for B: 68.39746�, and 111.60254�.
For each possible measure of angle B, we use C = 180  A  B, giving us 86.60254� or 43.39746�.Law of Sines OR Law of Cosines can be used to find the remaining side, c.
To find side c, for each possible angle C, we can use the law of cosines or the law of sines.
Using the Law of Cosines, c² = a² + b²  2 a b cos(C)
Using the Law of Sines, c = a sin(C)/sin(A)
Using either method, the solutions are c = 11.81021, or c = 8.12856.
If you know the lengths of all three sides, you can solve for any angle:
A = acos((b²+c²a²)/(2bc))
B = acos((c²+a²b²)/(2ca))
C = acos((a²+b²c²)/(2ab))
example
Suppose a=56, b=97, c=112.
A = acos((b²+c²a²)/(2bc)) = 29.99999986�
B = acos((c²+a²b²)/(2ca)) = 60.00527405�
C = acos((a²+b²c²)/(2ab)) = 89.99472609�This is an amusing example, because it's a triangle that's almost a right triangle: a²+b²=12545, and c²=12544. In addition, this triangle has almost a 60� angle: c²+a²b²=6271, and 2ca=6272. To find more examples of near 306090 triangles, look for the continued fraction convergents to sqrt(3).
a is an element of A002530,
b is an element of A002531, and
c = 2a
Mathworld: AAS, SAS, ASS, and SSS theorems.
OEIS: A002530, A002531, denominators and numerators of convergents to sqrt(3).
Law of Cosines: c² = a² + b² − 2ab cos C
Inscribed Angle Property  that all angles that are inscribed in a circle that are subtended by a given chord have equal measure, and that measure is half the central angle subtended by the same chord.
The webmaster and author of this Math Help site is Graeme McRae.