The two lines x=ay+b,z=cy+d; and x=a'y+b',z=c'y+d' are perpendicular to each other if
aa'+cc'=−1
aa'+cc'=1
Equation of lines x−ba=y=z−dc
x−b'a'=y=z−d'c'
Line are perpendicular ⇒ aa'+1+cc'=0