//>>built
define("dojox/gfx/arc",["./_base","dojo/_base/lang","./matrix"],function(x,z,b){function n(d){var f=Math.cos(d);d=Math.sin(d);var c={x:f+4/3*(1-f),y:d-4/3*f*(1-f)/d};return{s:{x:f,y:-d},c1:{x:c.x,y:-c.y},c2:c,e:{x:f,y:d}}}var p=2*Math.PI,t=Math.PI/4,q=Math.PI/8,y=t+q,u=n(q);return x.arc={unitArcAsBezier:n,curvePI4:u,arcAsBezier:function(d,f,c,a,h,k,l,g){h=!!h;k=!!k;var m=b._degToRad(a);a=f*f;var r=c*c,e=b.multiplyPoint(b.rotate(-m),{x:(d.x-l)/2,y:(d.y-g)/2}),v=e.x*e.x,w=e.y*e.y;a=Math.sqrt((a*r-a*
w-r*v)/(a*w+r*v));isNaN(a)&&(a=0);a={x:a*f*e.y/c,y:-a*c*e.x/f};h==k&&(a={x:-a.x,y:-a.y});a=b.multiplyPoint([b.translate((d.x+l)/2,(d.y+g)/2),b.rotate(m)],a);f=b.normalize([b.translate(a.x,a.y),b.rotate(m),b.scale(f,c)]);a=b.invert(f);d=b.multiplyPoint(a,d);g=b.multiplyPoint(a,l,g);l=Math.atan2(d.y,d.x);a=l-Math.atan2(g.y,g.x);k&&(a=-a);0>a?a+=p:a>p&&(a-=p);c=q;g=u;c=k?c:-c;d=[];for(h=a;0<h;h-=t)h<y&&(c=h/2,g=n(c),c=k?c:-c,h=0),e=b.normalize([f,b.rotate(l+c)]),k?(a=b.multiplyPoint(e,g.c1),m=b.multiplyPoint(e,
g.c2),e=b.multiplyPoint(e,g.e)):(a=b.multiplyPoint(e,g.c2),m=b.multiplyPoint(e,g.c1),e=b.multiplyPoint(e,g.s)),d.push([a.x,a.y,m.x,m.y,e.x,e.y]),l+=2*c;return d}}});