The angle between two intersecting circles at a common point P is defined as the angle between their tangents at P -- equivalently (since each tangent is perpendicular to its own radius), the angle between the two radii C1P and C2P, where C1,C2 are the centres.
Let the circles have centres C1,C2, radii r1,r2, and let d=C1C2 be the distance between the centres. In triangle C1PC2, the sides are C1P=r1, C2P=r2, and C1C2=d, and the included angle at P is the angle θ between the circles. The cosine rule in this triangle gives
d2=r12+r22−2r1r2cosθ⟹cosθ=2r1r2d2−r12−r22.
This can be rewritten purely in terms of the circles' coefficients. For S≡x2+y2+2gx+2fy+c=0 and S′≡x2+y2+2g′x+2f′y+c′=0, the centres are (−g,−f) and (−g′,−f′), so d2=(g−g′)2+(f−f′)2, while r12=g2+f2−c and r22=g′2+f′2−c′. Substituting and expanding:
d2−r12−r22=(g−g′)2+(f−f′)2−(g2+f2−c)−(g′2+f′2−c′)=c+c′−2gg′−2ff′,
since the squared terms g2,g′2,f2,f′2 all cancel. Hence …