% region1.m
%
% Program to plot region of integration in xy plane
%
% region between h_1(y) and h_2(y) between y=c and y=d
%
%

     hold off;
     y=(1:.05:2);
     x1=2-(y-1.5).^2;
     x2=1+(y-1.5).^2;
     lx=length(x1);
     plot(x1,y,'w');
     hold on;
     plot(x2,y,'w');
     axis([0 2.5 0 2.5]);
     plot([.5 .5 ],[0 2.5],'w');
     plot([0 2.5 ],[.5 .5],'w');
     
%     xf=[x1-.05 fliplr(x2)+.05 1.75-.05];
%     yf=[y fliplr(y) 1];
%     fill(xf,yf,'red');

     plot([x1(1) x2(1)],[y(1) y(1)],'w--');
     plot([x1(lx) x2(lx)],[y(lx) y(lx)],'w--');


     xbox1=[x1(11) x2(11)];
     ybox1=[y(11) y(11)];
     plot(xbox1,ybox1,'w--');
     xbox2=[x1(12) x2(12)];
     ybox2=[y(12) y(12)];
     plot(xbox2,ybox2,'w--');

%     xbox=[x(11) x(11) x(12) x(12) x(11)];
%     ff=.01
%     ybox=[y2(11)+ff y1(11)-ff y1(12)-ff y2(12)+ff y2(11)+ff];
%     fill(xbox,ybox,'red');

     ybox=[y(11) y(12) y(12) y(11) y(11)];
     ff=.01
     xbox=[x2(11)+ff x2(12)+ff x1(12)-ff x1(11)-ff x2(11)+ff];
     fill(xbox,ybox,'red');

     plot([0.48 0.52],[y(11) y(11)],'w--');
     text(.35,y(11)-.05,'y');
     plot([0.48 0.52],[y(12) y(12)],'w--');
     text(.25,y(12)+.05,'y+dy');

     plot([0.48 0.52],[1 1],'w');
     plot([0.48 0.52],[2 2],'w');
     text(.35,1.01,'c');
     text(.35,2.01,'d');

     text(2.3,.35,'x');
     text(.35,2.35,'y');

     text(2.0,1.8,'H_2(y)');
     text(.75,1.8,'H_1(y)');
     
