# Angle Between Two Straight Lines described by Homogeneous Quadratic Equation

## Theorem

Let $\LL_1$ and $\LL_2$ represent $2$ straight lines in the Cartesian plane which are represented by a homogeneous quadratic equation $E$ in two variables:

$E: \quad a x^2 + 2 h x y + b y^2$

Then the angle $\psi$ between $\LL_1$ and $\LL_2$ is given by:

$\tan \psi = \dfrac {2 \sqrt {h^2 - a b} } {a + b}$

## Proof

Let us rewrite $E$ as follows:

$b y^2 + 2 h x y + a x^2 = b \paren {y - \mu_1 x} \paren {y - \mu_2 x}$
$\LL_1$ and $\LL_2$ are represented by the equations $y = \mu_1 x$ and $y = \mu_2 x$ respectively.
$\mu_1 + \mu_2 = -\dfrac {2 h} b$
$\mu_1 \mu_2 = \dfrac a b$
$\tan \psi = \dfrac {\mu_1 - \mu_2} {1 + \mu_1 \mu_2}$

We have that:

 $\ds \paren {\mu_1 - \mu_2}^2$ $=$ $\ds \paren {\mu_1 + \mu_2}^2 - 4 \mu_1 \mu_2$ $\ds$ $=$ $\ds \paren {-\dfrac {2 h} b}^2 - 4 \dfrac a b$ $\ds$ $=$ $\ds \dfrac {4 \paren {h^2 - a b} } {b^2}$ $\ds \leadsto \ \$ $\ds \tan \psi$ $=$ $\ds \dfrac {\sqrt {4 \paren {h^2 - a b} / b^2} } {1 + a / b}$ $\ds$ $=$ $\ds \dfrac {2 \sqrt {\paren {h^2 - a b} } } {a + b}$ multiplying top and bottom by $b$ and simplifying

$\blacksquare$