i.e. abc + 2fgh − af² − bg² − ch² = 0. This is the necessary and sufficient condition.
The general second degree equation:
S≡ax2+2hxy+by2+2gx+2fy+c=0
represents a pair of lines if it factors as (l1x+m1y+n1)(l2x+m2y+n2)=0.
Derivation
Expanding the product and comparing coefficients:
a=l1l2,b=m1m2,c=n1n2
2h=l1m2+l2m1,2g=l1n2+l2n1,2f=m1n2+m2n1
For this system to have a solution, the determinant of the symmetric matrix of S must vanish:
Δ=ahghbfgfc=0
Expanding: Δ=abc+2fgh−af2−bg2−ch2=0.
Finding the intersection point
The intersection of the two lines is the solution of:
ax+hy+g=0andhx+by+f=0
(These are the partial derivatives ∂S/∂x=0 and ∂S/∂y=0, halved.)
Angle between the lines
The angle depends only on the homogeneous part ax2+2hxy+by2:
tanθ=a+b2h2−ab
The terms 2gx+2fy+c translate the pair but do not rotate it.