How do I use the Law of Cosines to calculate an angle from three points?

1.5k Views Asked by At

This is very simple to do in Geogebra, where I simply place the three points on the coordinate system, and use the "Angle" tool to click on the three of them, and immediately I receive an angle value on the 2nd point that I clicked of the three.

For example, using the Angle tool, when you click on (5,5) then (4,7) then (0,-1) you can see that the remaining value of (4,7) is 306.87 degrees, because 53.13 degrees have been eliminated by the region formed when I connected the three points. I hope I am being clear enough.

Now the issue is, I need to do this on paper, without Geogebra, and mathematics is not what I am good at. I've looked around, and people have said that the solution is to use the Law of Cosines and they mention arccos. I don't know how to apply this properly.

If someone could provide an example, it would help me a lot. For example, what if I wanted to do this with (7, 4) (5, 3) (0, -1)? Thanks for any insight.

2

There are 2 best solutions below

3
On BEST ANSWER

$A=(7,4), B=(5,3), C=(0,-1)$

\begin{align} a = BC = \sqrt{(5-0)^2+(3+1)^2} &= \sqrt{41} \\ b = AC = \sqrt{(7-0)^2+(4+1)^2} &= \sqrt{74}\\ c = AB = \sqrt{(7-5)^2+(4-3)^2} &= \sqrt{5} \end{align}

\begin{align} \cos \angle B &= \dfrac{a^2-b^2+c^2}{2ac} \\ &= \dfrac{41-74+5}{2\sqrt{205}} \\ &= -0.97780 \end{align}

$$\text{So} \quad m\angle B = 167.9^\circ$$

4
On

In order to use the law of cosines, you start by using the distance formula $\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$ to compute the length of each of the sides in the triangle formed by your three points.

Then you can use the law of cosines $$ c^2 = a^2 + b^2 - ab\cos C $$ to isolate $\cos C$. Once you know $\cos C$, take the inverse cosine function (arccos, often written $\cos^{-1}$ on calculators) of that to find the angle $C$.

Since in most of the terms here you only need the square of the side, there's no need to compute the square roots in the distance formula explicitly. You'll just need a single square root for $ab=\sqrt{a^2b^2}$.


However, if you start with coordinates, it may be easier to simply compute the angle between each of your lines and the $x$-axis by $$ \tan v = \frac{y_2-y_1}{x_2-x_1} \qquad\text{so}\quad v = \tan^{-1}\Bigl(\frac{y_2-y_1}{x_2-x_1}\Bigr) \;\;\bigl[\pm 180^\circ\text{ if }x_2<x_1\bigr] $$ and then subtract those angles.