Calculate the angle from the given points coordinates. I'm trying to figure out the way to calculate the a angle value from given coordinates of three points as showed on the illustration below:

I know how to calculate the a angle from the triangle's base length and its height, but in this case I'm stucked. I'll appreciate any help.
EDIT
The a value should be expressed in degrees. Also, the points coordinates can vary. 
 A: This is the solution (be aware that your figure is misleading):
$$ A = (150 - 100, 50 - 100) = (50, -50) $$
$$ B = (180 - 100, 100 - 100) = (80, 0) $$
$$ \cos\Theta = \dfrac{A \cdot B}{|A||B|} = \dfrac{400}{50\sqrt{2} \times 80} = \dfrac{1}{\sqrt{2}} $$
$$ \Rightarrow \Theta = \dfrac\pi4 $$
A: Drop a perpendicular from $x_1y_1$ to get a right triangle with the adjacent and opposite of $a$ both equal to $50$. Hence $a=\pi/4$ (because $\tan a = {O\over A} = {50\over 50} = 1$).
EDIT: Note $\pi/4$ radians equals $45$ degrees. The result here is invariant under translation (it stays the same when the points move).
A: The angle being non-dimensional, we can proportionally divide the vector magnitude by $10$ for convenience of calculation. The $(i,j)$ are unit vectors along $(x,y)$ axes
$$ \vec{P2 \;P0} =(8i+0j)$$
$$ \vec{P1 \;P0} =(5i-5j)$$
Using scalar dot product
$$ \cos  a = \dfrac{a_1b_1+a_2b_2}{|A| \cdot |B|}$$
$$ \cos a = \dfrac{40}{\sqrt{64(25+25)}}= \dfrac{40}{8\cdot\sqrt2 \cdot 5}= \dfrac{1}{\sqrt 2}$$
or
$$ a = \dfrac{\pi}{4}=45^{\circ}$$
