//>>built
define("demos/doGeo/src/wink/math/_matrix/js/matrix",["dojo","dijit","dojox"],function(_1,_2,_3){wink.json.concat(wink.math,{createTransformMatrix:function(_4){var _5=new wink.math.Matrix({});if(wink.isset(_4)){_5.loadCssTransform(_4);}return _5;}});wink.math.Matrix=function(_6){this.uId=wink.getUId();this._properties=_6;this._values=[];this._cssMatrix=null;if(this._validateProperties()===false){return;}this._initProperties();};wink.math.Matrix.prototype={scale:function(x,y,z){var _7=this._cssMatrix.scale(x,y,z);var _8=this._cssMatrixToValues(_7);this._load(_8);},translate:function(x,y,z){var _9=this._cssMatrix.translate(x,y,z);var _a=this._cssMatrixToValues(_9);this._load(_a);},rotateAxisAngle:function(x,y,z,_b){var _c=this._cssMatrix.rotateAxisAngle(x,y,z,_b);var _d=this._cssMatrixToValues(_c);this._load(_d);},multiply:function(_e){var _f=this._cssMatrix.multiply(_e.getCssMatrix());var _10=this._cssMatrixToValues(_f);this._load(_10);},clone:function(){return new wink.math.Matrix({values:this._values});},loadCssTransform:function(_11){var _12=null;if(isString(_11)){var _13="matrix3d";var _14=_11;var _15=_14.indexOf(_13);if(_15!=-1){var _16=_14.substring((_13.length+1),(_14.length-1));var _17=_16.split(", ");var m=[];for(var i=0;i<_17.length;i++){m[i]=_17[i]*1;}this._load(m);}}else{try{var _18=this._cssMatrixToValues(_11);this._load(_18);}catch(e){wink.log("[Matrix] Error: bad WebKitCSSMatrix");}}},getValues:function(){return this._values;},getCssMatrix:function(){return this._cssMatrix;},_validateProperties:function(){if(wink.isset(this._properties.values)&&this._properties.values.length!=16){wink.log("[Matrix] Error: values should be number 16");return false;}return true;},_initProperties:function(){if(wink.isset(this._properties.values)){this._load(this._properties.values);}else{this._loadIdentity();}},_loadIdentity:function(){this._load([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);},_load:function(_19){if(!wink.isset(_19)||_19.length!=16){wink.log("[Matrix] Error: values should be number 16");return false;}this._values=_19;this._cssMatrix=this._valuesToCssMatrix(this._values);},_valuesToCssMatrix:function(_1a){var _1b=new WebKitCSSMatrix();_1b.m11=_1a[0];_1b.m12=_1a[1];_1b.m13=_1a[2];_1b.m14=_1a[3];_1b.m21=_1a[4];_1b.m22=_1a[5];_1b.m23=_1a[6];_1b.m24=_1a[7];_1b.m31=_1a[8];_1b.m32=_1a[9];_1b.m33=_1a[10];_1b.m34=_1a[11];_1b.m41=_1a[12];_1b.m42=_1a[13];_1b.m43=_1a[14];_1b.m44=_1a[15];return _1b;},_cssMatrixToValues:function(_1c){var _1d=[];_1d[0]=_1c.m11;_1d[1]=_1c.m12;_1d[2]=_1c.m13;_1d[3]=_1c.m14;_1d[4]=_1c.m21;_1d[5]=_1c.m22;_1d[6]=_1c.m23;_1d[7]=_1c.m24;_1d[8]=_1c.m31;_1d[9]=_1c.m32;_1d[10]=_1c.m33;_1d[11]=_1c.m34;_1d[12]=_1c.m41;_1d[13]=_1c.m42;_1d[14]=_1c.m43;_1d[15]=_1c.m44;return _1d;}};});