%
%       Given an ellipse in the form: ax^2+bxy+cy^2+dx+ey+f=0
%       finds the standard form: ((x-cx)/r1)^2 + ((y-cy)/r2)^2 = 1
%       returning [r1 r2 cx cy theta]
function v = solveellipse(a)

        d = -(a / a(6))
        delta = d(2)*d(2) - 4*d(1)*d(3)
        disc = 0.5*sqrt((d(1)-d(3))*(d(1)-d(3)) - d(2)*d(2))
        ir1 = 0.5*(d(1)+d(3)) + disc
        ir2 = 0.5*(d(1)+d(3)) - disc
        r1 = 1/sqrt(ir1)
        r2 = 1/sqrt(ir2)
        cx = 0;
        cy = 0;
        theta = 0;
        v = [r1 r2 cx cy theta];

        
