function [baller,baller2] = newton2(x0, y0, error, func1, func2)

syms x y;

symdudx = diff(func1,x);
symdvdx = diff(func2,x);
symdudy = diff(func1,y);
symdvdy = diff(func2,y);

ex = 100000;
ey = 100000;

while (error < abs(ex) || error < abs(ey))
    dudx = subs(symdudx,[x,y],[x0,y0]);
    dvdx = subs(symdvdx,[x,y],[x0,y0]);
    dudy = subs(symdudy,[x,y],[x0,y0]);
    dvdy = subs(symdvdy,[x,y],[x0,y0]);
    ui = subs(func1,[x,y],[x0,y0]);
    vi = subs(func2,[x,y],[x0,y0]);
    
    xjared = x0 - (ui*dvdy - vi*dudy)/(dudx*dvdy - dudy*dvdx);
    yjared = y0 - (vi*dudx - ui*dvdx)/(dudx*dvdy - dudy*dvdx);
    
    ex = (xjared - x0)/(xjared);
    ey = (yjared - y0)/(yjared);
    
    x0 = xjared;
    y0 = yjared;    
end

baller = x0;
baller2 = y0;