# Law of cosines

### From Math Images

(Difference between revisions)
|           |                                         |           |                                         |
|-----------|-----------------------------------------|-----------|-----------------------------------------|
|           |                                         | ()        |                                         |
| Line 42:  |                                         | Line 42:  |                                         |
|           |                                         |           |                                         |
|           | ===Solution===                          |           | ===Solution===                          |
| -         |                                         | +         | {{hide|1=                               |
|           | To find the side length <math>c</math>, |           | To find the side length <math>c</math>, |
|           |                                         |           |                                         |
| Line 103: |                                         | Line 103: |                                         |
|           |                                         |           |                                         |
|           | [[Image:SAS_solution.jpg]]              |           | [[Image:SAS_solution.jpg]]              |
|           |                                         | +         | }}                                      |

## Revision as of 11:36, 30 May 2011

The law of cosines is a formula that helps in triangulation when two or three side lengths of a triangle are known. The formula relates all three side lengths of a triangle to the cosine of a particular angle.

$c^{2} = a^{2} + b^{2} - 2ab \cos C$

When to use it: SAS, SSS.

## Proof

Let $\vartriangle ABC$ be oriented so that $C$ is at the origin, and $B$ is at the point$(a,0)$.

### Distance Formula

$distance = \sqrt {(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^{2}}$

$c$ is the distance from $A$ to $B$.

Substituting the appropriate points into the distance formula gives us

$c = \sqrt {(a-b \cos C)^{2} + (0-b \sin C)^{2}}$

Squaring the inner terms, we have

$c = \sqrt {(a^{2}-2ab \cos C+b^{2} \cos^{2} C) + (b^{2} \sin^{2} C)}$

Since $\cos^{2} C + \sin^{2} C = 1$,

$c = \sqrt {(a^{2}+b^{2}-2ab \cos C+b^{2}}$

Square both sides for

$c^{2} = (a^{2}+b^{2}-2ab \cos C+b^{2}$

## Example Triangulation

Complete the triangle using the law of cosines.

$c^{2} = a^{2} + b^{2} - 2ab \cos C$

### Solution

To find the side length $c$,

$c^{2} = 6^{2} + (6 \sqrt{2})^{2} -2 (6) (6 \sqrt{2}) \cos 45^\circ$

Simplify for

$c^{2} =36 + 36 (2) - 72 \sqrt{2}) \cos 45^\circ$

Since $\cos 45^\circ = \frac{1}{\sqrt{2}}$, substitution gives us

$c^{2} =36 + 36 (2) - 72 \sqrt{2} (\frac{1}{\sqrt{2}})$

Simplify for

$c^{2} =36 + 72 - 72$

$c^{2} =36$

Taking the square root of both sides gives us

$c =6$

Now we can orient the triangle differently to get get a new version of the law of cosines so we can find angle measure $B$,

$b^{2} = a^{2} + c^{2} - 2ab \cos B$

Substituting in the appropriate side lengths gives us

$(6 \sqrt{2})^{2} = 6^{2} + 6^{2} - 2(6)(6) \cos B$

Simplify for

$36 (2) = 36 + 36 - 72 \cos B$

$72 = 72 - 72 \cos B$

Subtracting $72$ from both sides gives us

$0 = - 72 \cos B$

Dividing both sides by $-72$ gives us

$0 = \cos B$

Using inverse trig, we know that

$B = 90^\circ$

And we can find the last angle measure $A$ by subtracting the other two measures from $180^\circ$

$180^\circ - 90^\circ - 45^\circ = 45^\circ$

$A=45^\circ$
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 37, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8185712099075317, "perplexity_flag": "middle"}