# law of cosine

**URL:** https://boards.straightdope.com/t/law-of-cosine/603799
**Category:** Factual Questions
**Created:** [November 22, 2011, 9:48pm UTC](https://boards.straightdope.com/t/law-of-cosine/603799 "2011-11-22T21:48:41Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![vanotd21](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vanotd21](https://boards.straightdope.com/u/vanotd21)
#### Post date: [November 22, 2011, 9:48pm UTC](https://boards.straightdope.com/t/law-of-cosine/603799/1 "2011-11-22T21:48:41Z")

</div>

Sigh…why is this not coming out? I have a problem where i am given the two lengths of a triangle and an angle. In this case, a = 6.8, c =2.4, with angle beta= 10.5°. I find length b easily with b= 4.5, but the remaining two angles aren’t matching with the textbook. Using the law of cosine, angle alpha came out to 159.8°, but the book came out with 163.9°. What gives?

---

<div class="post-metadata">

### Author: ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)
#### Post date: [November 22, 2011, 10:29pm UTC](https://boards.straightdope.com/t/law-of-cosine/603799/2 "2011-11-22T22:29:44Z")

</div>

This might just be a rounding error. Try keeping a few more digits of your answer for b when you’re solving for alpha, and see if it helps.

---

<div class="post-metadata">

### Author: ![Jamicat](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Jamicat](https://boards.straightdope.com/u/Jamicat)
#### Post date: [November 22, 2011, 11:02pm UTC](https://boards.straightdope.com/t/law-of-cosine/603799/3 "2011-11-22T23:02:05Z")

</div>

I use trig everyday and I cant remember jack cept’ how to set a sine bar…

I thought u bisected into two right triangles…180 - 10.5 - 10.5 = 159 … but my calcualor sucks.

☹

---

<div class="post-metadata">

### Author: ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)
#### Post date: [November 22, 2011, 11:51pm UTC](https://boards.straightdope.com/t/law-of-cosine/603799/4 "2011-11-22T23:51:02Z")

</div>

I will second MikeS. Your value for b is off just enough, I suspect, to account for the discrepancy. Remember (or learn that cos changes rather slowly at angles that are near 0 or 180, so that a small change in length might result in a large change in the angle. Using the rule of sines, I came up with 163.87.

---

<div class="post-metadata">

### Author: ![mcgato](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mcgato](https://boards.straightdope.com/u/mcgato)
#### Post date: [November 23, 2011, 12:13am UTC](https://boards.straightdope.com/t/law-of-cosine/603799/5 "2011-11-23T00:13:22Z")

</div>

A quick calculation by me got b=4.4617, which is far enough from 4.5 to cause a few degree difference on the angles.

---

<div class="post-metadata">

### Author: ![AaronX](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AaronX](https://boards.straightdope.com/u/AaronX)
#### Post date: [November 23, 2011, 1:53am UTC](https://boards.straightdope.com/t/law-of-cosine/603799/6 "2011-11-23T01:53:25Z")

</div>

If you have 3 lengths and an angle, try using the sine rule to get the other angles? The one that says angle/length = angle/length

---

<div class="post-metadata">

### Author: ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)
#### Post date: [November 23, 2011, 2:10am UTC](https://boards.straightdope.com/t/law-of-cosine/603799/7 "2011-11-23T02:10:24Z")

</div>

I second everyone who says it’s a rounding error, but I also note that calculating the length of b is not necessarily the easiest way to get the answer. Ease is in the eye of the beholder, mind you, but I assume what you did was calculate the length of b from a, c, and beta, using the law of cosines, and then the angle alpha from a, b, and c using the law of cosines again.

It might be easier to calculate alpha via its tangent rather than its cosine: b \* sin(alpha) = a \* sin(beta) [laying the triangle with c as its base, this is the height of the opposite corner], and b \* cos(a) + a \* cos(beta) = c [here we are summing the (signed) horizontal displacements of the corner opposite c from the other two corners]. Combining these, we have that tan(alpha) = sin(alpha)/cos(alpha) = (a \* sin(beta))/(c - a \* cos(beta)). [The bs cancel out]. Plugging in a, beta, and c gives you tan(alpha) = -0.28911876…; taking the inverse tangent of this (within the range from 0 to 180 degrees) gives you 163.874426… degrees, as the book says.

---

<div class="post-metadata">

### Author: ![Xema](https://avatars.discourse-cdn.com/v4/letter/x/9de053/32.png) [@Xema](https://boards.straightdope.com/u/Xema)
#### Post date: [November 23, 2011, 5:05am UTC](https://boards.straightdope.com/t/law-of-cosine/603799/8 "2011-11-23T05:05:34Z")

</div>

> [@Hari\_Seldon](#):
>
> Using the rule of sines, I came up with 163.87.

This [triangle calculator](http://www.handymath.com/cgi-bin/irregangle8.cgi) agrees.

---

<div class="post-metadata">

### Author: ![vanotd21](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vanotd21](https://boards.straightdope.com/u/vanotd21)
#### Post date: [November 23, 2011, 10:55am UTC](https://boards.straightdope.com/t/law-of-cosine/603799/9 "2011-11-23T10:55:09Z")

</div>

yes, it was a rounding error. I wasn’t including enough numbers when I attempted to find the arc cosine of the number.  
on a side note, is it possible to use the law of sine with this problem?  
A 40 ft. wide house has a roof with a 6-12 pitch(the roof rises 6 ft for a run of 12 ft). The owner plans a 14 ft wide addition that will have a 3-12 pitch to its roof. Find the lengths.

I figured you could only use the law of cosine since there are no angles for you to work from.
