I've been working on an algorithm that includes a step in which it has to calculate the angle between two 2D lines.
I've done some research and I've found this formula:
$\tan \theta = \pm \frac{m_2 - m_1}{1 + m_1m_2}$,
in which $m_1$ and $m_2$ are the slopes of the lines written in the form $y = mx + b$.
I also found this formula:
$\tan \theta = \pm \frac{A_2 B_1 - A_1 B_2}{A_1 A_2 + B_1 B_2}$,
in which $A_1, A_2, B_1, B_2$ are the parameters of the lines written in the form $Ax + By + C = 0$.
According to one book I've found, both formulas are equivalent. I've tried to prove that they're equivalent, but haven't managed to get it right so far.
Can someone please point me in the right direction so I can prove that both formulas are equivalent?