% nodal
% https://octave.sourceforge.io/octave/function/contour.html

reso = 512
lw = -pi/2
ub = pi/2
[X, Y] = meshgrid (linspace (lw,ub,reso), linspace (lw,ub,reso));
%Z = X.^2-Y.^2-2;

disp(' ')
Z = 0;
%N = 5*13*9
N = 5*13*17
disp(' ')
disp(N)
disp(' ')
for k = 0:floor(sqrt(N))
    l = sqrt(N-k^2);
    if ~mod(l,1)
        disp(['k = ' num2str(k) '   l = ' num2str(l) ])
        Z += 4*cos(k*X).*cos(l*Y) + 4*cos(l*X).*cos(k*Y);
    end
end


figure(1)
clf;
colormap ("default");
contour (X,Y,Z, [0 0], 'k');
axis('equal')
%title ({"contour() plot with single isoline at Z == 0"});
saveas(gcf,'borri.png')

