general equation of a circle:x^2+y^2+2gx+2fy+c=0: points lie on the circle are (0,.0)(a,0) and (0,b).
by putting (0,0),we get c=0;
by putting (a,0),we get a^2+2ga =0:
by putting (0,b),we get b^2+2fb =0:
hence a =-2g,b =-2f
and equation of circle will be x^2+y^2-ax-by =0