Packagestarling.utils
Classpublic class MatrixUtil
InheritanceMatrixUtil Inheritance Object

A utility class containing methods related to the Matrix class.



Public Methods
 MethodDefined By
  
convertTo2D(matrix3D:Matrix3D, resultMatrix:Matrix = null):Matrix
[static] Converts a 3D matrix to a 2D matrix.
MatrixUtil
  
convertTo3D(matrix:Matrix, resultMatrix:Matrix3D = null):Matrix3D
[static] Converts a 2D matrix to a 3D matrix.
MatrixUtil
  
prependMatrix(base:Matrix, prep:Matrix):void
[static] Prepends a matrix to 'base' by multiplying it with another matrix.
MatrixUtil
  
prependRotation(matrix:Matrix, angle:Number):void
[static] Prepends an incremental rotation to a Matrix object (angle in radians).
MatrixUtil
  
prependScale(matrix:Matrix, sx:Number, sy:Number):void
[static] Prepends an incremental scale change to a Matrix object.
MatrixUtil
  
prependSkew(matrix:Matrix, skewX:Number, skewY:Number):void
[static] Prepends a skew transformation to a Matrix object (angles in radians).
MatrixUtil
  
prependTranslation(matrix:Matrix, tx:Number, ty:Number):void
[static] Prepends an incremental translation to a Matrix object.
MatrixUtil
  
skew(matrix:Matrix, skewX:Number, skewY:Number):void
[static] Appends a skew transformation to a matrix (angles in radians).
MatrixUtil
  
transformCoords(matrix:Matrix, x:Number, y:Number, resultPoint:Point = null):Point
[static] Uses a matrix to transform 2D coordinates into a different space.
MatrixUtil
  
transformCoords3D(matrix:Matrix3D, x:Number, y:Number, z:Number, resultPoint:Vector3D = null):Vector3D
[static] Uses a matrix to transform 3D coordinates into a different space.
MatrixUtil
  
transformPoint(matrix:Matrix, point:Point, resultPoint:Point = null):Point
[static]
MatrixUtil
  
transformPoint3D(matrix:Matrix3D, point:Vector3D, resultPoint:Vector3D = null):Vector3D
[static]
MatrixUtil
Method Detail
convertTo2D()method
public static function convertTo2D(matrix3D:Matrix3D, resultMatrix:Matrix = null):Matrix

Converts a 3D matrix to a 2D matrix. Beware that this will work only for a 3D matrix describing a pure 2D transformation.

Parameters

matrix3D:Matrix3D
 
resultMatrix:Matrix (default = null)

Returns
Matrix
convertTo3D()method 
public static function convertTo3D(matrix:Matrix, resultMatrix:Matrix3D = null):Matrix3D

Converts a 2D matrix to a 3D matrix. If you pass a 'resultMatrix', the result will be stored in this matrix instead of creating a new object.

Parameters

matrix:Matrix
 
resultMatrix:Matrix3D (default = null)

Returns
Matrix3D
prependMatrix()method 
public static function prependMatrix(base:Matrix, prep:Matrix):void

Prepends a matrix to 'base' by multiplying it with another matrix.

Parameters

base:Matrix
 
prep:Matrix

prependRotation()method 
public static function prependRotation(matrix:Matrix, angle:Number):void

Prepends an incremental rotation to a Matrix object (angle in radians).

Parameters

matrix:Matrix
 
angle:Number

prependScale()method 
public static function prependScale(matrix:Matrix, sx:Number, sy:Number):void

Prepends an incremental scale change to a Matrix object.

Parameters

matrix:Matrix
 
sx:Number
 
sy:Number

prependSkew()method 
public static function prependSkew(matrix:Matrix, skewX:Number, skewY:Number):void

Prepends a skew transformation to a Matrix object (angles in radians). The skew matrix has the following form:

          | cos(skewY)  -sin(skewX)  0 |
          | sin(skewY)   cos(skewX)  0 |
          |     0            0       1 |
          

Parameters

matrix:Matrix
 
skewX:Number
 
skewY:Number

prependTranslation()method 
public static function prependTranslation(matrix:Matrix, tx:Number, ty:Number):void

Prepends an incremental translation to a Matrix object.

Parameters

matrix:Matrix
 
tx:Number
 
ty:Number

skew()method 
public static function skew(matrix:Matrix, skewX:Number, skewY:Number):void

Appends a skew transformation to a matrix (angles in radians). The skew matrix has the following form:

          | cos(skewY)  -sin(skewX)  0 |
          | sin(skewY)   cos(skewX)  0 |
          |     0            0       1 |
          

Parameters

matrix:Matrix
 
skewX:Number
 
skewY:Number

transformCoords()method 
public static function transformCoords(matrix:Matrix, x:Number, y:Number, resultPoint:Point = null):Point

Uses a matrix to transform 2D coordinates into a different space. If you pass a 'resultPoint', the result will be stored in this point instead of creating a new object.

Parameters

matrix:Matrix
 
x:Number
 
y:Number
 
resultPoint:Point (default = null)

Returns
Point
transformCoords3D()method 
public static function transformCoords3D(matrix:Matrix3D, x:Number, y:Number, z:Number, resultPoint:Vector3D = null):Vector3D

Uses a matrix to transform 3D coordinates into a different space. If you pass a 'resultVector', the result will be stored in this vector3D instead of creating a new object.

Parameters

matrix:Matrix3D
 
x:Number
 
y:Number
 
z:Number
 
resultPoint:Vector3D (default = null)

Returns
Vector3D
transformPoint()method 
public static function transformPoint(matrix:Matrix, point:Point, resultPoint:Point = null):Point

Parameters

matrix:Matrix
 
point:Point
 
resultPoint:Point (default = null)

Returns
Point
transformPoint3D()method 
public static function transformPoint3D(matrix:Matrix3D, point:Vector3D, resultPoint:Vector3D = null):Vector3D

Parameters

matrix:Matrix3D
 
point:Vector3D
 
resultPoint:Vector3D (default = null)

Returns
Vector3D