Suppose we have two non-perpendicular lines of slopes $m_1$ and $m_2$ in the cartesian plane. There are two angles that the lines make with each other , $θ$ and $π-θ$ as shown in below figure.

We know that angles between line of slopes $m_1$ and $m_2$ is given by :
$$\tan θ= ±\left(\frac{m_1 - m_2} {1+m_1m_2}\right) $$
The problem was to find that angle between the lines whose angular region contains the point $P(a,b)$ ; which is $\theta$ according to figure.
My teacher said , that $\theta$ is given by :
$$ \tan θ= +\left(\frac{m_1 - m_2} {1+m_1m_2}\right) $$
He said that it is $m_1-m_2$ in the numerator instead of $m_2-m_1$ because when you traverse from the line of slope $m_1$ to line of slope $m_2$ , then you move in clockwise direction. Hence , we have to take this. In other words , he said that the procedure is always is to take the $+/-$ sign such that the movement corresponding to terms in numerator is clockwise.
However , I am unable to prove that why this procedure works.