Measure angle between two segments with one shared point

229 Views Asked by At

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$?

2

There are 2 best solutions below

0
On 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}}$$

0
On

You can use the formula for the dot-product: $$\vec{a}\circ\vec{b}=|\vec{a}||\vec{b}|\cos(\alpha)$$