% finds the (x-x0)^2 + (y-y0)^2 = r^2 parameters for a
% circle defined by p(1)*(x^2 + y^2) + p(2)*x + p(3)*y + p(4) = 0
function [x0,y0,r] = solvecircle(p)

        x0 = -p(2)/(2*p(1));
        y0 = -p(3)/(2*p(1));
        r = sqrt( p(4)/p(1) - x0*x0 - y0*y0);
