x_n = []; y_n = []; psi_n = [];
x_z = []; y_z = []; psi_z = [];
x_p = []; y_p = []; psi_p = [];

for y_i = -2:0.1:2
    for x_i = -2:0.1:2
        
        psi_i =  (min(0, x_i + y_i))^2 - 2*x_i*y_i;

        if psi_i < 0
            x_n = [x_n; x_i];
            y_n = [y_n; y_i];
            psi_n = [psi_n; psi_i];
        elseif psi_i > 0
            x_p = [x_p; x_i];
            y_p = [y_p; y_i];
            psi_p = [psi_p; psi_i];
        elseif psi_i == 0
            x_z = [x_z; x_i];
            y_z = [y_z; y_i];
            psi_z = [psi_z; psi_i];
        end
    end
end

plot3(x_z, y_z, psi_z, '.g');
grid on;
hold on;
plot3(x_p, y_p, psi_p, '.r');
hold on;
plot3(x_n, y_n, psi_n, '.b');
hold off;

