# Law of Cosines Distance Formula Proof

So I'm trying to understand a law of cosines proof that involves the distance formula and I'm having trouble. I've included the proof below from wikipedia that I'm trying to follow. What I'm have trouble understanding is the way they define the triangle point A.

I've always been taught that cosine represents $\frac{adj}{hyp}$ so I'm not sure what cosine represents outside the context of a right triangle. After I understand this I can follow the proof I'm just trying to understand how $b \cos\gamma,\ b \sin\gamma$ represent the x and y coordinates with a generic angle in $\gamma$. Any other resources or advice would be appreciated.

$A = (b \cos\gamma,\ b \sin\gamma),\ B = (a,\ 0),\ \text{and}\ C = (0,\ 0)\,.$

By the distance formula, we have $c = \sqrt{(a - b \cos\gamma)^2 + (0 - b \sin\gamma)^2}\,.$

Now, we just work with that equation: :\begin{align} c^2 & {} = (a - b \cos\gamma)^2 + (- b \sin\gamma)^2 \\ c^2 & {} = a^2 - 2 a b \cos\gamma + b^2 \cos^2 \gamma + b^2 \sin^2 \gamma \\ c^2 & {} = a^2 + b^2 (\sin^2 \gamma + \cos^2 \gamma) - 2 a b \cos\gamma \\ c^2 & {} = a^2 + b^2 - 2 a b \cos\gamma\,. \end{align}

-
– robjohn♦ Jun 1 '12 at 4:16
– Joe Jun 1 '12 at 4:16

1
I actually think I've figured it out, writing out your question really helps you learn. I think I was just setting up my triangles wrong, I noticed a right triangle can be formed that makes sense. – Math_Illiterate Jun 1 '12 at 4:22

## 1 Answer

$c$ is the length of the line $AB$, i.e. from $(b \cos\gamma,\ b \sin\gamma)$ to $(a,\ 0)$, which has horizontal component $a - b \cos\gamma$ and vertical component $0 - b \sin\gamma$.

So using Pythagoras, $c = \sqrt{(a - b \cos\gamma)^2 + (0 - b \sin\gamma)^2}$.

Then expand, and simplify using Pythagoras again in $\sin^2 \gamma + \cos^2 \gamma =1$.

-
{"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": 13, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "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": 5, "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.917787492275238, "perplexity_flag": "head"}