/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.math.curves"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.math.curves"]){_4._hasResource["dojox.math.curves"]=true;_4.provide("dojox.math.curves");_4.getObject("math.curves",true,_6);_4.mixin(_6.math.curves,{Line:function(_7,_8){this.start=_7;this.end=_8;this.dimensions=_7.length;for(var i=0;i<_7.length;i++){_7[i]=Number(_7[i]);}for(var i=0;i<_8.length;i++){_8[i]=Number(_8[i]);}this.getValue=function(n){var _9=new Array(this.dimensions);for(var i=0;i<this.dimensions;i++){_9[i]=((this.end[i]-this.start[i])*n)+this.start[i];}return _9;};return this;},Bezier:function(_a){this.getValue=function(_b){if(_b>=1){return this.p[this.p.length-1];}if(_b<=0){return this.p[0];}var _c=new Array(this.p[0].length);for(var k=0;j<this.p[0].length;k++){_c[k]=0;}for(var j=0;j<this.p[0].length;j++){var C=0;var D=0;for(var i=0;i<this.p.length;i++){C+=this.p[i][j]*this.p[this.p.length-1][0]*_6.math.bernstein(_b,this.p.length,i);}for(var l=0;l<this.p.length;l++){D+=this.p[this.p.length-1][0]*_6.math.bernstein(_b,this.p.length,l);}_c[j]=C/D;}return _c;};this.p=_a;return this;},CatmullRom:function(_d,c){this.getValue=function(_e){var _f=_e*(this.p.length-1);var _10=Math.floor(_f);var _11=_f-_10;var i0=_10-1;if(i0<0){i0=0;}var i=_10;var i1=_10+1;if(i1>=this.p.length){i1=this.p.length-1;}var i2=_10+2;if(i2>=this.p.length){i2=this.p.length-1;}var u=_11;var u2=_11*_11;var u3=_11*_11*_11;var _12=new Array(this.p[0].length);for(var k=0;k<this.p[0].length;k++){var x1=(-this.c*this.p[i0][k])+((2-this.c)*this.p[i][k])+((this.c-2)*this.p[i1][k])+(this.c*this.p[i2][k]);var x2=(2*this.c*this.p[i0][k])+((this.c-3)*this.p[i][k])+((3-2*this.c)*this.p[i1][k])+(-this.c*this.p[i2][k]);var x3=(-this.c*this.p[i0][k])+(this.c*this.p[i1][k]);var x4=this.p[i][k];_12[k]=x1*u3+x2*u2+x3*u+x4;}return _12;};if(!c){this.c=0.7;}else{this.c=c;}this.p=_d;return this;},Arc:function(_13,end,ccw){function _14(a,b){var c=new Array(a.length);for(var i=0;i<a.length;i++){c[i]=a[i]+b[i];}return c;};function _15(a){var b=new Array(a.length);for(var i=0;i<a.length;i++){b[i]=-a[i];}return b;};var _16=_6.math.midpoint(_13,end);var _17=_14(_15(_16),_13);var rad=Math.sqrt(Math.pow(_17[0],2)+Math.pow(_17[1],2));var _18=_6.math.radiansToDegrees(Math.atan(_17[1]/_17[0]));if(_17[0]<0){_18-=90;}else{_18+=90;}_6.math.curves.CenteredArc.call(this,_16,rad,_18,_18+(ccw?-180:180));},CenteredArc:function(_19,_1a,_1b,end){this.center=_19;this.radius=_1a;this.start=_1b||0;this.end=end;this.getValue=function(n){var _1c=new Array(2);var _1d=_6.math.degreesToRadians(this.start+((this.end-this.start)*n));_1c[0]=this.center[0]+this.radius*Math.sin(_1d);_1c[1]=this.center[1]-this.radius*Math.cos(_1d);return _1c;};return this;},Circle:function(_1e,_1f){_6.math.curves.CenteredArc.call(this,_1e,_1f,0,360);return this;},Path:function(){var _20=[];var _21=[];var _22=[];var _23=0;this.add=function(_24,_25){if(_25<0){console.error("dojox.math.curves.Path.add: weight cannot be less than 0");}_20.push(_24);_21.push(_25);_23+=_25;_26();};this.remove=function(_27){for(var i=0;i<_20.length;i++){if(_20[i]==_27){_20.splice(i,1);_23-=_21.splice(i,1)[0];break;}}_26();};this.removeAll=function(){_20=[];_21=[];_23=0;};this.getValue=function(n){var _28=false,_29=0;for(var i=0;i<_22.length;i++){var r=_22[i];if(n>=r[0]&&n<r[1]){var _2a=(n-r[0])/r[2];_29=_20[i].getValue(_2a);_28=true;break;}}if(!_28){_29=_20[_20.length-1].getValue(1);}for(var j=0;j<i;j++){_29=_6.math.points.translate(_29,_20[j].getValue(1));}return _29;};function _26(){var _2b=0;for(var i=0;i<_21.length;i++){var end=_2b+_21[i]/_23;var len=end-_2b;_22[i]=[_2b,end,len];_2b=end;}};return this;}});}}};});