// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/layers/vectorTiles/core/libs/gl-matrix/mat2",["./common"],function(g){var d={create:function(){var a=new g.ARRAY_TYPE(4);a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},clone:function(a){var b=new g.ARRAY_TYPE(4);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];return a},identity:function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},fromValues:function(a,b,c,e){var h=new g.ARRAY_TYPE(4);h[0]=a;h[1]=b;h[2]=c;h[3]=e;return h},set:function(a,
b,c,e,h){a[0]=b;a[1]=c;a[2]=e;a[3]=h;return a},transpose:function(a,b){if(a===b){var c=b[1];a[1]=b[2];a[2]=c}else a[0]=b[0],a[1]=b[2],a[2]=b[1],a[3]=b[3];return a},invert:function(a,b){var c=b[0],e=b[1],h=b[2],d=b[3],f=c*d-h*e;if(!f)return null;f=1/f;a[0]=d*f;a[1]=-e*f;a[2]=-h*f;a[3]=c*f;return a},adjoint:function(a,b){var c=b[0];a[0]=b[3];a[1]=-b[1];a[2]=-b[2];a[3]=c;return a},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},multiply:function(a,b,c){var e=b[0],d=b[1],k=b[2];b=b[3];var f=c[0],
g=c[1],l=c[2];c=c[3];a[0]=e*f+k*g;a[1]=d*f+b*g;a[2]=e*l+k*c;a[3]=d*l+b*c;return a}};d.mul=d.multiply;d.rotate=function(a,b,c){var e=b[0],d=b[1],g=b[2];b=b[3];var f=Math.sin(c);c=Math.cos(c);a[0]=e*c+g*f;a[1]=d*c+b*f;a[2]=e*-f+g*c;a[3]=d*-f+b*c;return a};d.scale=function(a,b,c){var e=b[1],d=b[2],g=b[3],f=c[0];c=c[1];a[0]=b[0]*f;a[1]=e*f;a[2]=d*c;a[3]=g*c;return a};d.fromRotation=function(a,b){var c=Math.sin(b),e=Math.cos(b);a[0]=e;a[1]=c;a[2]=-c;a[3]=e;return a};d.fromScaling=function(a,b){a[0]=b[0];
a[1]=0;a[2]=0;a[3]=b[1];return a};d.str=function(a){return"mat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};d.frob=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+Math.pow(a[3],2))};d.LDU=function(a,b,c,e){a[2]=e[2]/e[0];c[0]=e[0];c[1]=e[1];c[3]=e[3]-a[2]*c[1];return[a,b,c]};d.add=function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];a[2]=b[2]+c[2];a[3]=b[3]+c[3];return a};d.subtract=function(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]-c[1];a[2]=b[2]-c[2];a[3]=b[3]-c[3];return a};d.sub=
d.subtract;d.exactEquals=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]};d.equals=function(a,b){var c=a[0],e=a[1],d=a[2],k=a[3],f=b[0],m=b[1],l=b[2],n=b[3];return Math.abs(c-f)<=g.EPSILON*Math.max(1,Math.abs(c),Math.abs(f))&&Math.abs(e-m)<=g.EPSILON*Math.max(1,Math.abs(e),Math.abs(m))&&Math.abs(d-l)<=g.EPSILON*Math.max(1,Math.abs(d),Math.abs(l))&&Math.abs(k-n)<=g.EPSILON*Math.max(1,Math.abs(k),Math.abs(n))};d.multiplyScalar=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*
c;a[3]=b[3]*c;return a};d.multiplyScalarAndAdd=function(a,b,c,d){a[0]=b[0]+c[0]*d;a[1]=b[1]+c[1]*d;a[2]=b[2]+c[2]*d;a[3]=b[3]+c[3]*d;return a};return d});