function ezsurfhs(f,c,d,h1,h2)
% ezsurfhs(f,c,d,h1,h2)
%
% plot graph of f over horizontally simple region
%   c <= y <= d
%  h1 <= x <= h2
% where f is symbolic expression of x,y
% h1,h2 are symbolic expressions of y
% 
% Example: top part of sphere with radius 1
%   syms x y
%   f = sqrt(1-x^2-y^2)
%   h1 = -sqrt(1-y^2)
%   h2 = sqrt(1-y^2)
%   ezsurfhs(f,-1,1,h1,h2)
%   nice3d

c = double(c); d = double(d);
f = sym(f); 
h1 = sym(h1); h2 = sym(h2);

syms x y
syms XT YT
XX = (1-XT)*h1+XT*h2;
FT = subs(f,x,XX);
ezsurf(subs(XX,y,YT),YT,subs(FT,y,YT)+0*XT+0*YT,[0,1,c,d])
p = findobj(gca,'type','surface'); p = p(1);
set(p,'MeshStyle','row','FaceColor','interp');

title('')


