# If two lines make an angle $\alpha$ on their intersection. Prove that $\cos\alpha = \frac{a_1a_2+b_1b_2}{\sqrt{a_1^2+b_1^2}\sqrt{a_2^2+b_2^2}}$

If two lines $$a_1x+b_1y+c_1=0$$ and $$a_2x+b_2y+c_2=0$$ make an angle $$\alpha$$ on their intersection. Prove that $$\cos\alpha = \frac{a_1a_2+b_1b_2}{\sqrt{a_1^2+b_1^2}\sqrt{a_2^2+b_2^2}}$$

I have seen a question with $$\sin \alpha$$ instead, but the answer uses the $$\tan \alpha$$, if the easier way of proving this is using $$m_1=-\frac{a_1}{b_1},m_2=-\frac{a_2}{b_2}$$

$$\tan\alpha=\left|\frac{m_1-m_2}{1+m_1m_2}\right|$$

I would like to have the logic/demonstration of it too, as I can't see it, I am trying to prove this using geometry and trigonometry, not vectors

Using values as you have mentioned, $$m_1=-\frac{a_1}{b_1},m_2=-\frac{a_2}{b_2}$$
$$\tan\alpha=\left|\frac{m_1-m_2}{1+m_1m_2}\right|$$ $$\tan\alpha=\left|\frac{a_1b_2-a_2b_1}{a_1a_2+b_1b_2}\right|$$
$$\sec^2\alpha = 1 + tan^2 \alpha = \frac{(a_1^2+b_1^2)(a_2^2+b_2^2)}{(a_1a_2+b_1b_2)^2}$$
$$\cos\alpha = \frac{1}{\sec\alpha} = \frac{a_1a_2+b_1b_2}{\sqrt{a_1^2+b_1^2}\sqrt{a_2^2+b_2^2}}$$
• This is because slope of a line $m$ is $tan\theta$. For a more comprehensive explanation, you can look at the derivation here. byjus.com/maths/angle-between-two-lines – gemspark Aug 30 '20 at 6:01
• @Juju9704 You can show this either by drawing a bunch of perpendicular lines, so that every angle of interest lies in some triangle with a right angle. But you can also appeal to the formula $\tan (a+b) = \frac{\tan a + \tan b}{1-\tan a \tan b}$. – Trebor Aug 30 '20 at 7:59