I use Asymptote
to make the graphics. I have two curves defined as contours C_1 and C_2. I want to fill the area
between the two curves. The problem is that contour returns a guide
structure in Asymptote, and this is not accepted to to buildcycle
command. Can anyone tell me how to solve this problem ? Thanks.
This is the code I use and which produces the two curves, but fails to fill area between these.
import graph;
import patterns;
import contour;
usepackage("mathrsfs");
size(8cm);
real eps=0.001;
real xmax=5.5,ymax=5.5;
pair af,ag;
real f(real x, real y) {return sqrt(1+x)-sqrt(x)+sqrt(1+y)-sqrt(y);}
real g(real x, real y) {return 1/sqrt(1+x)+1/sqrt(1+y);}
guide[][] Cf=contour(f,(eps,eps),(xmax,ymax),new real[] {1});
guide[][] Cg=contour(g,(eps,eps),(xmax,ymax),new real[] {1});
//these two lines are used to find intersection points
path D1=(0,ymax)--(xmax+eps,ymax);
path D2=(xmax,0)--(xmax,ymax+eps);
draw(Cf);
draw(Cg);
//path pp=buildcycle(Cf,D1,Cg,D2);
// the preceding line produces and error if commented
xaxis(Label(scale(0.75)*"$x$"),xmax=6,Arrow);
yaxis(Label(rotate(90)*scale(0.75)*"$y$"),ymax=6,Arrow);
label("$\mathscr{C}_{1}$",(xmax,0.2));
label("$\mathscr{C}_{2}$",(xmax,1.9));
label("I" ,(.2,.2));
label("II" ,(1.,1.));
label("III",(3.5,3.5));
end;
contour
to produce the lines? It seems a rather complicated way to produce a single curve.