Calculate angle in triangle having 2 points and two lines

229 Views Asked by At

I have 2 points $B$ and $P$ and need to calculate angle $\alpha$ (maybe also I will need point $C$ and $E$)

enter image description here

How can I do this. I know that I can calculate point $D$ it's $(\frac{1}{2}(x_P-x_B), \frac{1}{2}(y_P-y_B))$ then calculate line that it's perpendicular to $PB$ and that go through $D$ and then intercections with lines $x=x_B$ and $y=y_B$, if I have point $E$ I can calculate angle from triangle $PDE$, but need exact formula to do this.

2

There are 2 best solutions below

1
On BEST ANSWER

First, assume $B=(0,0)$ (by translation). $A$ seems irrelevant to me, but if we have $C$, by symmetry the angle $$90^\circ - \angle EBD = \angle CEB = \alpha$$ $$\angle EBD = \arccos(y_D/|\overline{BD}|)= \arccos(y_P/|\overline{PB}|)$$ and finally we have $$\alpha = \arcsin\left(\frac{x_P}{\sqrt{x_P^2+y_P^2}}\right)$$ Translating back, we get $$\alpha = \arcsin\left(\frac{x_P-x_B}{\sqrt{(x_P-x_B)^2 + (y_P-y_B)^2}}\right)$$

0
On

Hint: Start by finding the equation of line $PB$, then use it to find the equation of line $DE$. Substitute $x=x_B$ into this last equation in order to calculate point $E$. Now that you know points $P,D,$ and $E$, we can use the distance formula in order to find the lengths of $PD$ and $DE$. Then you can calculate the required angle by using: $$ \alpha = \tan^{-1} \left( \dfrac{PD}{DE} \right) $$