Lesson Solve triangles using Law of Cosines
Algebra
->
Trigonometry-basics
-> Lesson Solve triangles using Law of Cosines
Log On
Algebra: Trigonometry
Section
Solvers
Solvers
Lessons
Lessons
Answers archive
Answers
Source code of 'Solve triangles using Law of Cosines'
This Lesson (Solve triangles using Law of Cosines)
was created by by
ikleyn(53937)
:
View Source
,
Show
About ikleyn
:
<H2>Solve triangles using Law of Cosines</H2> This lesson is a continuation of the previous one, <A HREF= http://www.algebra.com/algebra/homework/Trigonometry-basics/Proof-of-the-Law-of-Cosines-revisited.lesson> Proof_of_the_Law_of_Cosines_Revisited</A>, where the Theorem <B>Law of Cosines</B> was formulated and proved. Examples of usage of the <B>Law of Cosines</B> theorem are considered in this lesson. Let me start this lesson from reminding the <B>Law of Cosines</B> Theorem. <TABLE cellspacing="10"> <TR> <TD> <B><U>Theorem (Law of Cosines)</U></B> <B>For any triangle, with the side lengths a, b, c and opposite angles {{{alpha}}}, {{{beta}}} and {{{gamma}}}</B> {{{c^2 = a^2 +b^2 - 2*a*b*cos(gamma)}}}, {{{b^2 = a^2 +c^2 - 2*a*c*cos(beta)}}}, {{{a^2 = b^2 +c^2 - 2*b*c*cos(alpha)}}}. <B>Figures 1a)</B> and <B>1b)</B> illustrate the Theorem, showing an acute and an obtuse triangles. The side <B>a</B> is opposite to the vertex <B>A</B> and the angle {{{alpha}}}. The side <B>b</B> is opposite to the vertex <B>B</B> and the angle {{{beta}}}. The side <B>c</B> is opposite to the vertex <B>C</B> and the angle {{{gamma}}}. As it stated, the Theorem is valid for any triangle. </TD> <TD> {{{drawing( 200, 200, 0.5, 5.5, 0.5, 4.5, line( 1, 1, 5, 1 ), line( 1, 1, 4, 4 ), line( 5, 1, 4, 4), locate ( 1, 1, A), locate ( 4.2, 4, B), locate ( 5, 1, C), locate ( 4.7, 2.8, a), locate ( 2.0, 2.8, c), locate ( 3.0, 1, b), locate ( 1.5, 1.4, alpha), locate ( 3.8, 3.6, beta), locate ( 4.5, 1.4, gamma) )}}} <B>Figure 1a. Acute Triangle</B> </TD> <TD> {{{drawing( 300, 200, 0.5, 7.5, 0.5, 4.5, line( 1, 1, 5, 1 ), line( 1, 1, 7, 4 ), line( 5, 1, 7, 4), locate ( 1, 1, A), locate ( 7.2, 4, B), locate ( 5, 1, C), locate ( 6.3, 2.7, a), locate ( 3.7, 2.8, c), locate ( 3.0, 1, b), locate ( 1.8, 1.4, alpha), locate ( 6.3, 3.6, beta), locate ( 4.7, 1.4, gamma) )}}} <B>Figure 1b. Obtuse Triangle</B> </TD> </TR> </TABLE> Below are couple examples of using the <B>Law of Sines</B> to solve triangles. The term <B>"to solve the triangle"</B> means <B>"to calculate unknown elements of the triangle using given data"</B>. <B>Example 1. Use the Law of Cosines to Solve <B>SAS</B> Triangle</B>. <TABLE cellspacing="10"> <TR> <TD> Solve the triangle: <B>b</B>=5, {{{alpha}}}=35°, <B>c</B>=4.864. This is so named <B>SAS</B> case: two sides of the triangle are given along with the angle between them. <B>Figure 3</B> is the sketch to illustrate the triangle we are going to solve. First, find the third side <B>a</B>. Since {{{a^2 = b^2 +c^2 - 2*b*c*cos(alpha)}}} (<B>Law of Cosines</B>) and cos(35°)=0.819, we have {{{a^2 = 5^2 +4.864^2 - 2*5*4.864*0.819}}}=8.815, a = 2.969. Next, calculate {{{cos(beta)}}} using <B>Law of Cosines</B> with known sides <B>a</B>, <B>c</B> and <B>b</B>: {{{b^2=a^2+c^2-2*a*c*cos(beta)}}}, {{{cos(beta)=(a^2+c^2-b^2)/(2*a*c)}}} = {{{(2.969^2+4.864^2-5^2)/(2*2.969*4.864)=0.259}}}, and {{{beta}}}=75°. Now, calculate the third angle {{{gamma}}} of the triangle, having known other two, {{{alpha}}} and {{{beta}}}: {{{gamma}}} = 180° - {{{(alpha+beta)}}} = 180° - (35°+75°) = 180° - 110° = 70°. </TD> <TD> {{{drawing( 200, 200, 0.5, 5.5, 0.5, 4.5, line( 1, 1, 5, 1 ), line( 1, 1, 4, 3.2 ), line( 5, 1, 4, 3.2), locate ( 1, 1, A), locate ( 4.2, 3.2, B), locate ( 5, 1, C), locate ( 4.7, 2.3, a), locate ( 2.0, 2.3, c), locate ( 3.0, 1, b), locate ( 1.5, 1.4, alpha), locate ( 3.8, 3.0, beta), locate ( 4.5, 1.4, gamma) )}}} <B>Figure 3. Example 1</B> </TD> </TR> </TABLE> The solution is unique in this case. <B>Example 2. Use the Law of Cosines to Solve <B>SSS</B> Triangle</B>. <TABLE cellspacing="10"> <TR> <TD> Solve the triangle: <B>a</B> = 2.969</B>, <B>b</B> = 5, <B>c</B>=4.864. This is <B>SSS</B> case: three sides of the triangle are given. <B>Figure 4</B> illustrates the triangle we are going to solve. First, find the angle {{{alpha}}} using <B>Law of Cosines</B> with known sides <B>a</B>, <B>b</B> and <B>c</B>. Since {{{a^2 = b^2 +c^2 - 2*b*c*cos(alpha)}}} (<B>Law of Cosines</B>), you have {{{cos(alpha) = (b^2+c^2-a^2)/(2*b*c)=(5^2+4.864^2-2.969^2)/(2*5*4.864)=0.819}}}. Hence, {{{alpha=arccos(0.819)}}}=35°. Next, find the angle {{{beta}}} by the similar way: {{{b^2=a^2+c^2-2*a*c*cos(beta)}}}, {{{cos(beta)=(a^2+c^2-b^2)/(2*a*c)}}} = {{{(2.969^2+4.864^2-5^2)/(2*2.969*4.864)=0.259}}}, and {{{beta}}}=75°. Now, calculate the third angle {{{gamma}}} of the triangle, having known other two, {{{alpha}}} and {{{beta}}}: {{{gamma}}} = 180° - {{{(alpha+beta)}}} = 180° - (35°+75°) = 180° - 110° = 70°. </TD> <TD> {{{drawing( 200, 200, 0.5, 5.5, 0.5, 4.5, line( 1, 1, 5, 1 ), line( 1, 1, 4, 3.2 ), line( 5, 1, 4, 3.2), locate ( 1, 1, A), locate ( 4.2, 3.2, B), locate ( 5, 1, C), locate ( 4.7, 2.3, a), locate ( 2.0, 2.3, c), locate ( 3.0, 1, b), locate ( 1.5, 1.4, alpha), locate ( 3.8, 3.0, beta), locate ( 4.5, 1.4, gamma) )}}} <B>Figure 4. Example 2</B> </TD> </TR> </TABLE> The solution is unique in this case. <B><U>General recommendations on choosing strategy to solve triangles</U></B> 1) If you have ASA case (one side of the triangle and two adjacent angles are known), you may use the <B>Law of Sines</B>. See an example in the lesson <A HREF= http://www.algebra.com/algebra/homework/Trigonometry-basics/Solve-triangles-using-Law-of-Sines.lesson> Solve triangles using Law of Sines</A>. The solution is unique in this case. 2) If you have SAA case (one side of the triangle is known along with one adjacent angle and one opposite), you may use the <B>Law of Sines</B>. See an example in the lesson <A HREF= http://www.algebra.com/algebra/homework/Trigonometry-basics/Solve-triangles-using-Law-of-Sines.lesson> Solve triangles using Law of Sines</A>. The solution is unique in this case. 3) If you have SSA case (two sides of the triangle are known along with the angle opposite one of them), you may use the <B>Law of Sines</B>. See examples in the lesson <A HREF= http://www.algebra.com/algebra/homework/Trigonometry-basics/Solve-triangles-using-Law-of-Sines.lesson> Solve triangles using Law of Sines</A>. This is an <B>ambiguous</B> case. Depending on the input, the solution may not exist, be unique or be non-unique in this case. 4) If you have SAS case (two sides of the triangle are known along with the angle between them), you may use the <B>Law of Cosines</B>. See an example in <B>this</B> lesson. The solution is unique in this case. 5) If you have SSS case (three sides of the triangle are known), you may use the <B>Law of Cosines</B>. See an example in <B>this</B> lesson. The solution is unique in this case. For navigation over the lessons on Properties of Triangles use this file/link <A HREF=https://www.algebra.com/algebra/homework/Triangles/Compendium-of-properties-of-triangles.lesson>Properties of Trianles</A>. To navigate over all topics/lessons of the Online Geometry Textbook use this file/link <A HREF=https://www.algebra.com/algebra/homework/Triangles/GEOMETRY-your-online-textbook.lesson>GEOMETRY - YOUR ONLINE TEXTBOOK</A>.