function plot3dFofXY(f, xpoints, ypoints)
% plot 3d surface of function of two variables 'x' and 'y'
% f - handle to a function which accept a 2 element vector i.e. 'v'
%    v(1) is 'x' 
%    v(2) is 'y'
% xpoints array of x points to be evaluated
% ypoints array of y points to be evaluated

Nx=length(xpoints);
Ny=length(ypoints);
z=zeros(Nx,Ny);


for i=1:Nx
	for j=1:Ny
		z(j,i)=f([xpoints(i),ypoints(j)]);
	end
end

surf(xpoints,ypoints,z); colormap('default')

end

		
