%% ----------------------------------------------------------------
clf;
rotate3d on;
hold on;

%% ----------------------------------------------------------------
%n = 4;
n = 20;
%n = 100;

xlo = -2.0;
xhi =  2.0;
nx  =  n;
dx  = (xhi - xlo) / nx;

ylo = -2.0;
yhi =  2.0;
ny  =  n;
dy  = (yhi - ylo) / ny;

[x,y] = meshgrid(xlo:dx:xhi, ylo:dy:yhi);

%% ----------------------------------------------------------------
%  w = xy
% dw = x dy + y dx

w = x.*y;

dwx = x;
dwy = y;

contour(w);
figure; % Open up a second window
quiver(x,y,dwx,dwy);

