% --- start of displayed preamble in the book ---
vardef hiddenpath(expr under,over)=
save p,q;
picture p,q;
p=image(draw under);clip p to over;
undraw p;
q=image(draw under dashed evenly);
clip q to over;
draw q;
enddef;
% --- end of displayed preamble in the book ---
defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
path p[];
p1=fullcircle scaled 3cm;
p2=fullcircle scaled 2cm shifted (2cm,0);
p3=fullcircle scaled 4cm shifted (1.5cm,2cm);
draw p1; % we draw the three circles totally
draw p2;
draw p3;
hiddenpath(p1,p2); % p1 hidden by p2
hiddenpath(p1,p3); % p1 p3
hiddenpath(p3,p2); % p3 p2
endfig;
end;