# angle between straight lines

• Mar 17th 2010, 04:41 AM
s_ingram
angle between straight lines
Hi folks,

I am trying to show that the angle between two straight lines is given by:

$\tan\theta = \frac{m_{1} - m_{2}}{1 + m_{1}m_{2}}$

I am using vector methods but my problem is the algebra. If the vector equation of a line is given by $\overline{r_{1}} = \overline{a_{1}} + \lambda \overline{b_{1}}$. And the second line by subscript 2, the angle between the lines is given by:

$\overline{b_{1}}.\overline{b_{2}} = |b_{1}||b_{2}| \cos\theta$

for a straight line of the form y = mx + c we have:

$r_{1} = \left( \begin{array}{c} x \\ y \end{array} \right) =
\left( \begin{array}{c} 0 \\ c_{1} \end{array} \right) + \lambda
\left( \begin{array}{c} 1 \\ m_{1} \end{array} \right)$

or,
$r_{1} = 0i + c_{1}j + \lambda (i + m_{1}j)$
$r_{2} = 0i + c_{2}j + \lambda (i + m_{2}j)$

So, the angle between the two lines is given by

$(1i + m_{1}j).(1i + m_{2}j) = \sqrt{1 + m^{2}_{1}}\sqrt{1 + m^{2}_{2}}. \cos\theta$

$1 + m_{1}m_{2} = \sqrt{(1 + m^{2}_{1})(1 + m^{2}_{2})}. \cos\theta$

At this stage I decided to square both sides and look for a chance to combine 1 and $\cos^2\theta$ to give $\sin^2 \theta$ then simplify and take a square root to get back to $\tan\theta$

instead things got very messy indeed. Am I on the right track? I know it's murder trying to type lots of algebra but I suspect there would be less algebra if it was done right! A few lines in the right direction would be greatly appreciated!

best regards
• Mar 17th 2010, 04:58 AM
HallsofIvy
Quote:

Originally Posted by s_ingram
Hi folks,

I am trying to show that the angle between two straight lines is given by:

$\tan\theta = \frac{m_{1} - m_{2}}{1 + m_{1}m_{2}}$

I am using vector methods but my problem is the algebra. If the vector equation of a line is given by $\overline{r_{1}} = \overline{a_{1}} + \lambda \overline{b_{1}}$. And the second line by subscript 2, the angle between the lines is given by:

$\overline{b_{1}}.\overline{b_{2}} = |b_{1}||b_{2}| \cos\theta$

for a straight line of the form y = mx + c we have:

$r_{1} = \left( \begin{array}{c} x \\ y \end{array} \right) =
\left( \begin{array}{c} 0 \\ c_{1} \end{array} \right) + \lambda
\left( \begin{array}{c} 1 \\ m_{1} \end{array} \right)$

or,
$r_{1} = 0i + c_{1}j + \lambda (i + m_{1}j)$
$r_{2} = 0i + c_{2}j + \lambda (i + m_{2}j)$

So, the angle between the two lines is given by

$(1i + m_{1}j).(1i + m_{2}j) = \sqrt{1 + m^{2}_{1}}\sqrt{1 + m^{2}_{2}}. \cos\theta$

$1 + m_{1}m_{2} = \sqrt{(1 + m^{2}_{1})(1 + m^{2}_{2})}. \cos\theta$

At this stage I decided to square both sides and look for a chance to combine 1 and $\cos^2\theta$ to give $\sin^2 \theta$ then simplify and take a square root to get back to $\tan\theta$

instead things got very messy indeed. Am I on the right track? I know it's murder trying to type lots of algebra but I suspect there would be less algebra if it was done right! A few lines in the right direction would be greatly appreciated!

best regards

What you say you are doing is correct. Since

$cos(\theta)= \frac{1+ m_1m_2}{\sqrt{1+ m_1^2}\sqrt{1+ m_2^2}}$

$cos^2(\theta)= \frac{1+ 2m_1m_2+ m_1^2+ m_2^2}{1+ m_1^2+ m_2^2+ m_1m_2^2}$

so
$sin^2(\theta)= 1- cos^2(\theta)= \frac{1+ m_1^2+ m_1^2+ m_1^2m_2^2- (1+ 2m_1m_2+ m_1^2m_2^2)}{(1+ m_1^2)(1+ m_2^2)}$

and the numerator reduces to $m_1^2- 2m_1m_2+ m_2^2$, a perfect square!

By the way, if you are nor required to use vectors, you might find it easier to use the trig identity $tan(\theta+ \phi)= \frac{tan(\theta)+ tan(\phi)}{1+ tan(\theta)tan(\phi)}$.
• Mar 17th 2010, 09:01 AM
s_ingram
Thanks again, HallsofIvy!

I tried it your way and it works fine. The problem I am having is that I don't always go the right way, particularly with algebra!

This is what I did and as you can see it rapidly gets out of hand even though I am not making any mistakes!

$(1 + m_{1}m_{2})^2 = (1 + m^2_{1} + m^2_{2} + m^2_{1}m^2_{2})\cos^2\theta$

$1 + 2m_{1}m_{2} + m^2_{1}m^2_{2} = \cos^2\theta + (m^2_{1} + m^2_{2}) \cos^2\theta + m^2_{1}m^2_{2}cos^2\theta$

$1 - \cos^2\theta = -m^2_{1}m^2_{2}(1 - \cos^2\theta) -2m_{1}m_{2} + (m^2_{1} + m^2_{2})\cos^2\theta$

$sin^2\theta = -m^2_{1}m^2_{2}\sin^2\theta -2m_{1}m_{2} + (m^2_{1} + m^2_{2})\cos^2\theta$

$\sin^2\theta(1 + m^2_{1}m^2_{2}) = -2m_{1}m_{2} + \cos^2\theta(m^2_{1} + m^2_{2})$

and as you can see I have this hanging $2m_{1}m_{2}$ term and no clear way to get to the required solution. Have I made a mistake and if not can you see how to get my final line into the answer we know and love?