nape.geom.Mat23

type
class
2D Matrix class representing affine transformations:

Note that in AS3, flash.geom.Matrix has 'b' and 'c' swapped! so if you are converting between flash.geom.Matrix and nape.geom.Mat23 you should use the methods provided to avoid any mistakes with this.

Static Methods

static function fromMatrix(matrix:flash.geom.Matrix):Mat23

+ Create a Mat23 matrix from a given AS3 flash.geom.Matrix.

static function rotation(angle:Float):Mat23

+ Construct a Mat23 representing a clockwise rotation.

static function scale(sx:Float, sy:Float):Mat23

+ Construct a Mat23 representing a scaling

static function translation(tx:Float, ty:Float):Mat23

+ Construct a Mat23 representing a translation

Constructor

function new(a:Float = 1, b:Float = 0, c:Float = 0, d:Float = 1, tx:Float = 0, ty:Float = 0)
+ Construct new Mat23.

Instance Properties

var a : Float = 1

+ The (1,1) entry in Mat23:

var b : Float = 0

+ The (1,2) entry in Mat23:

var c : Float = 0

+ The (2,1) entry in Mat23:

var d : Float = 1

+ The (2,2) entry in Mat23:

readonly var determinant : Float = 1

+ (readonly) The determinant of this matrix.

var tx : Float = 0

+ The (1,3) entry in Mat23 which represents x translation

var ty : Float = 0

+ The (2,3) entry in Mat23 which represents y translation

Instance Methods

function concat(matrix:Mat23):Mat23

+ Concatenate matrices (left-multiplication), returning new Mat23.

function copy():Mat23

+ Produce copy of this Mat23

function equiorthogonal():Bool

+ Determine if matrix is equiorthogonal

function equiorthogonalise():Mat23

+ Equiorthogonalise matrix.

function inverse():Mat23

+ Compute the inverse of this matrix, returning the inverse in a new

function inverseTransform(point:Vec2, noTranslation:Bool = false, weak:Bool = null):Vec2

+ Perform inverse transformation with Vec2, returning new Vec2.

function orthogonal():Bool

+ Determine if matrix is orthogonal

function orthogonalise():Mat23

+ Orthogonalise matrix.

inline function reset():Mat23

+ Reset matrix to identity.

function set(matrix:Mat23):Mat23

+ Set values of matrix from another.

function setAs(a:Float = 1, b:Float = 0, c:Float = 0, d:Float = 1, tx:Float = 0, ty:Float = 0):Mat23

+ Set values of matrix from numbers.

function singular():Bool

+ Determine if the matrix is singular.

function toMatrix(output:flash.geom.Matrix = null):flash.geom.Matrix

+ Create an AS3 flash.geom.Matrix from this Mat23.

function transform(point:Vec2, noTranslation:Bool = false, weak:Bool = null):Vec2

+ Transform a Vec2 by this matrix in new Vec2.

function transpose():Mat23

+ Compute the transpose of this matrix, returning the transpose in a new