Fill the intersection area of three circles

The underlying JavaScript code

JXG.joinCurves=function(board,parents,attributes){varcurves=parents,attr=JXG.copyAttributes(attributes,board.options,'curve'),c=board.create('curve',[[0],[0]],attr);c.updateDataArray=function(){vari,le=curves.length;// The paths have to be connectedthis.dataX=[];this.dataY=[];for(i=0;i<le;i++){if(i<le-1){this.dataX=this.dataX.concat(curves[i].dataX.slice(0,-1));this.dataY=this.dataY.concat(curves[i].dataY.slice(0,-1));}else{this.dataX=this.dataX.concat(curves[i].dataX);this.dataY=this.dataY.concat(curves[i].dataY);}}if(this.dataX.length<4){this.bezierDegree=1;}else{this.bezierDegree=curves[0].bezierDegree;}};c.prepareUpdate().update().updateVisibility().updateRenderer();returnc;};varbrd=JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-1,5,5,-1],axis:true});// Create two arcs (or circles)varp1=brd.create('point',[1,1]);varp2=brd.create('point',[3,0]);vara1=brd.create('circle',[p1,p2]);varp3=brd.create('point',[4,1]);varp4=brd.create('point',[2,0]);vara2=brd.create('circle',[p3,p4]);varp5=brd.create('point',[2.5,4.5]);varp6=brd.create('point',[-0.5,4.5]);vara3=brd.create('circle',[p5,p6]);// Create two intersection pointsvari1=brd.create('intersection',[a1,a2,1],{visible:true});vari2=brd.create('intersection',[a1,a3,0],{visible:true});vari3=brd.create('intersection',[a2,a3,1],{visible:true});// Create three arcs surrounding the intersection areavarc1=brd.create('arc',[p1,i2,i1],{visible:false});varc2=brd.create('arc',[p3,i1,i3],{visible:false});varc3=brd.create('arc',[p5,i3,i2],{visible:false});// Join the three arcs and fill the area.varc4=JXG.joinCurves(brd,[c1,c2,c3],{strokeColor:'black',strokeWidth:3,fillColor:'yellow',fillOpacity:0.2});