If two circles touch each other, then C1C2=r1+r2 ⇒(−g1+g2)2+(−f1+f2)2=g12+f12+g22+f22
Squaring both sides, we get −2g1g2−2f1f2=2(g12+f12)(g22+f22)
Again squaring, we get (g1f2)2+(g2f1)2−2g1g2f1f2=0 ⇒(g1f2−g2f1)2=0 ⇒g2g1=f2f1