Static variables
staticread only_1234:Matrix2x2
Used for testing
Matrix2x2._1234 == new Matrix2x2( { a: 1., b: 2., c: 3., d: 4. } )
staticread onlybottomLeft:Matrix2x2
>>> ({
... Matrix2x2.bottomLeft == new Matrix2x2( { a: -1., b: 0.
... , c: 0., d: -1. } );
... }) == true
staticread onlybottomRight:Matrix2x2
>>> ({
... Matrix2x2.bottomRight == new Matrix2x2( { a: 1., b: 0.
... , c: 0., d: -1. } );
... }) == true
staticread onlycounting:Matrix2x2
>>> Matrix2x2.counting == new Matrix2x2( { a: 1., b: 2., c: 3., d: 4. } )
staticread onlyeast:Matrix2x2
>>> ({
... Matrix2x2.east == new Matrix2x2( { a: 1., b: 0.
... , c: 0., d: 0. } );
... }) == true
staticread onlyminus1:Matrix2x2
>>> Matrix2x2.minus1 == new Matrix2x2({ a: -1., b: 0., c: 0., d: -1. })
staticread onlynorth:Matrix2x2
>>> ({
... Matrix2x2.north == new Matrix2x2( { a: 0., b: 0.
... , c: 0., d: 1. } );
... }) == true
staticread onlysouth:Matrix2x2
>>> ({
... Matrix2x2.south == new Matrix2x2( { a: 0., b: 0.
... , c: 0., d: -1. } );
... }) == true
staticread onlytopLeft:Matrix2x2
>>> ({
... Matrix2x2.topLeft == new Matrix2x2( { a: 1., b: 0.
... , c: 0., d: -1. } );
... }) == true
staticread onlytopRight:Matrix2x2
>>> ({
... Matrix2x2.topRight == new Matrix2x2( { a: 1., b: 0.
... , c: 0., d: 1. } );
... }) == true
Static methods
staticinlineadding(a:Matrix2x2, b:Matrix2x2):Matrix2x2
>>> ({
... var a = Matrix2x2.unit;
... a + a == new Matrix2x2({ a: 2., b: 0., c: 0., d: 2. });
... }) == true
staticinlineequal(a:Matrix2x2, b:Matrix2x2):Bool
>>> ({
... var a = new Matrix2x2({ a: 1., b: 2., c: 3., d: 4. });
... var b = new Matrix2x2({ a: 1., b: 2., c: 3., d: 4. });
... a == b; }) == true
staticinlinefromVec(vec:Vector<Float>):Matrix2x2
>>> ({
... var a = Matrix2x2.unit;
... var b = haxe.ds.Vector.fromArrayCopy([ 1., 0., 0., 1. ]);
... var c: Matrix2x2 = b;
... a == c;
... }) == true
staticinlinegetXY(this:Mat2x2, x:Int, y:Int):Float
>>> ({
... var a = new Matrix2x2({ a: 1., b: 2., c: 3., d: 4. });
... a.getXY( 0, 0 ) == 1 && a.getXY( 1, 0 ) == 2 && a.getXY( 0, 1 ) == 3 && a.getXY( 1, 1 ) == 4;
... }) == true
staticinlineiterator(this:Mat2x2):ArrayIterator<Float>
>>> ({
... var m = Matrix2x2.counting;
... var arr = new Array();
... for( i in m ){
... arr.push(i);
... }
... [1.,2.,3.,4.].toString() == arr.toString(); }) == true
staticinlinenegating(a:Matrix2x2):Matrix2x2
>>> ({
... var a = Matrix2x2.counting;
... var b = -a;
... b == new Matrix2x2({ a: -1., b: -2., c: -3., d: -4. }); }) == true
staticinlinenotEqual(a:Matrix2x2, b:Matrix2x2):Bool
>>> ({
... var a = new Matrix2x2({ a: 1., b: 2., c: 3., d: 1. });
... var b = new Matrix2x2({ a: 1., b: 2., c: 4., d: 1. });
... a != b; }) == true
staticinlinescale(p:Matrix1x2):Matrix2x2
>>> Matrix2x2.scale( new Matrix1x2( { x: 2., y: 2. } ) ) == new Matrix2x2( { a: 2., b: 0., c: 0., d: 2. } )
staticinlinesetXY(this:Mat2x2, x:Int, y:Int, v:Float):Matrix2x2
>>> ({
... var a = Matrix2x2.unit;
... a.setXY( 0, 0, 1. );
... a.setXY( 1, 0, 2. );
... a.setXY( 0, 1, 3. );
... a.setXY( 1, 1, 4. );
... var b = new Matrix2x2({ a: 1., b: 2., c: 3., d: 4. });
... a == b;
... }) == true
staticinlinesubtracting(a:Matrix2x2, b:Matrix2x2):Matrix2x2
>>> ({
... var a = Matrix2x2.unit;
... a - a == Matrix2x2.zero;
... }) == true