I'm studying for an upcoming test and found the following problem.

> 
> Find cosine of the inner angles of the triangle whose vertices are: $(3, 1, 1)$,
> $(−1, 2, 1)$, $(2, −2, 5)$.
> 
> 
> 

I was wondering if my solution is correct. Here's what I did.

---

> 
> Note: [a, b, ...] denotes a vector with componentes $a$, $b$, etc.
> 
> 
> 

Let $\vec{A}, \vec{B}, \vec{C}$ be the vectors pointing at each of the given points, respectively. The vectors that appropriately represent the sides of the triangle formed by these three points are

* $\vec{A}-\vec{B}= [4, -1, 0]$
* $\vec{A}-\vec{C}= [1, 3, -4]$
* $\vec{B}-\vec{C}=[-3, 4, -4]$

We shall use the fact that $\cos \theta = \frac{\vec{v} \cdot \vec{w}}{|\vec{v}||\vec{w}|}$ for the angle $\theta$ formed by the vectors $\vec{w}, \vec{w}$. Let $\vec{v}, \vec{w}, \vec{u}$ be each of the vectors computed above, respectively. Notice that $|\vec{v}|=\sqrt{17}, |\vec{w}|=\sqrt{26}, |\vec{u}|=\sqrt{41}$. Then

$i.$ $\cos \theta = \frac{1}{\sqrt{17}\sqrt{2
6}}$ is the cosine of the inner angle formed by $\overline{AB}$ and $\overline{AC}$

$ii.$ $\cos \beta = -\frac{26}{\sqrt{17}\sqrt{41}}$ is the cosine of the inner angle formed by $\overline{AB}$ and $\overline{BC}$.

$iii.$ $\cos \lambda = -\frac{25}{\sqrt{41}\sqrt{26}}$ is the cosine of the inner angle formed by $\overline{AC}$ and $\overline{BC}$.

---

Thanks in advance.