Measure angle between two segments with one shared point

anglegeometry

I have given points $A(x_1,y_1);B(x_2,y_2);C(x_3,y_3)$. I have two segments $CB; AB$. I need to measure angle $\alpha$, located between segments $AB$ and $CB$. Is there a formula to calculate angle $\alpha$?

Best Answer

$$\cos\alpha=\frac{AB\cdot CB}{|AB|\cdot|CD|}$$$$\cos\alpha=\frac{(x_1-x_2)\cdot(x_3-x_2) + (y_1-y_2)\cdot(y_3-y_2)}{\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\cdot\sqrt{(x_3-x_2)^2+(y_3-y_2)^2}}$$