Packagegraphics.geom
Classpublic class Matrix2
InheritanceMatrix2 Inheritance Object
Implements Geometry

Matrix with 4 rows and 4 columns.

Example :

     import graphics.geom.Matrix2 ;
     var m:Matrix2 = new Matrix2() ;
     // 1 0
     // 0 1
     



Public Properties
 PropertyDefined By
  n11 : Number
Defines a Matrix2 cell.
Matrix2
  n12 : Number
Defines a Matrix2 cell.
Matrix2
  n21 : Number
Defines a Matrix2 cell.
Matrix2
  n22 : Number
Defines a Matrix2 cell.
Matrix2
Public Methods
 MethodDefined By
  
Matrix2(... arguments)
Creates a new Matrix2 instance.
Matrix2
  
angle():Number
Indicates the angle value of the specified Matrix2 object.
Matrix2
  
clone():*
Returns a shallow copy of this instance.
Matrix2
  
equals(o:*):Boolean
Compares the specified object with this object for equality.
Matrix2
  
getEntry(x:Number, y:Number):*
Returns the matrix[x][y] value.
Matrix2
  
[static] Creates and returns a new Matrix2 with all this elements are 0.
Matrix2
  
identity():void
Transforms the matrix in this identity representation.
Matrix2
  
[static] Creates and returns a new identity Matrix2.
Matrix2
  
invert(out:Matrix2 = null):Matrix2
Invert the Matrix2 object.
Matrix2
  
isIdentity():Boolean
Returns true if the Matrix2 is the identity.
Matrix2
  
setByAngle(angle:Number):void
Sets the specified matrix with the passed-in angle value.
Matrix2
  
setByMatrix(matrix:Matrix2):void
Sets the specified matrix with the Matrix2 reference passed in argument.
Matrix2
  
Sets the specified matrix with the two passed-in Vector2 objects.
Matrix2
  
setEntry(x:Number, y:Number, value:*):void
Sets matrix[x][y] with the specified value.
Matrix2
  
toArray():Array
Returns the Array representation of this instance.
Matrix2
  
toObject():Object
Returns the Object representation of this object.
Matrix2
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
Matrix2
  
toString():String
Returns the string representation of the object.
Matrix2
Property Detail
n11property
public var n11:Number

Defines a Matrix2 cell.

         1 0
         0 0
         

n12property 
public var n12:Number

Defines a Matrix2 cell.

         0 1
         0 0
         

n21property 
public var n21:Number

Defines a Matrix2 cell.

         0 0
         1 0
         

n22property 
public var n22:Number

Defines a Matrix2 cell.

         0 0
         0 1
         

Constructor Detail
Matrix2()Constructor
public function Matrix2(... arguments)

Creates a new Matrix2 instance.

Parameters
... arguments
Method Detail
angle()method
public function angle():Number

Indicates the angle value of the specified Matrix2 object.

Returns
Number
clone()method 
public function clone():*

Returns a shallow copy of this instance.

Example :

         import graphics.geom.Matrix2 ;
         
         var m:Matrix2 = new Matrix2( 1, 2, 3, 4 ) ;
         trace( m + " clone() : " + m.clone() ) ;
         

Returns
* — a shallow copy of this instance.
equals()method 
public function equals(o:*):Boolean

Compares the specified object with this object for equality.

Parameters

o:*

Returns
Booleantrue if the the specified object is equal with this object.
getEntry()method 
public function getEntry(x:Number, y:Number):*

Returns the matrix[x][y] value.

Example :

         import graphics.geom.Matrix2 ;
         var m:Matrix2 = new Matrix2( 1, 2, 3, 4 ) ;
         trace( m + " getEntry(1,0) : " + m.getEntry(1,0) ) ; // [Matrix2:[1,2],[3,4]] getEntry(1,0) : 3
         

Parameters

x:Number
 
y:Number

Returns
* — the matrix[x][y] value.
getZero()method 
public static function getZero():Matrix2

Creates and returns a new Matrix2 with all this elements are 0.

Example :

import graphics.geom.Matrix2 ; var m:Matrix2 = Matrix2.getZero() ; // 0 0 // 0 0

Returns
Matrix2 — a new zero Matrix4 object.
identity()method 
public function identity():void

Transforms the matrix in this identity representation.

Example :

         import graphics.geom.Matrix2 ;
         var m:Matrix2 = new Matrix2( 1, 2, 3, 4 ) ;
         m.identity() ;
         trace( m + " identity : " + m ) ;
         

identity()method 
public static function identity():Matrix2

Creates and returns a new identity Matrix2.

Example :

import graphics.geom.Matrix2 ; var m:Matrix2 = Matrix2.identity() ; // 1 0 // 0 1

Returns
Matrix2 — a new identity Matrix2 object.
invert()method 
public function invert(out:Matrix2 = null):Matrix2

Invert the Matrix2 object.

Parameters

out:Matrix2 (default = null) — The optional Matrix2 reference to return. If this argument is null a new identity Matrix is created.

Returns
Matrix2
isIdentity()method 
public function isIdentity():Boolean

Returns true if the Matrix2 is the identity.

Example :

import graphics.geom.Matrix2 ; var m:Matrix2 ; m = new Matrix2() ; trace( m.isIdentify() ) ; // true m = new Matrix2(1,2,3,4) ; trace( m.isIdentify() ) ; // false

Returns
Booleantrue if the Matrix2 is the identity.
setByAngle()method 
public function setByAngle(angle:Number):void

Sets the specified matrix with the passed-in angle value.

Parameters

angle:Number

setByMatrix()method 
public function setByMatrix(matrix:Matrix2):void

Sets the specified matrix with the Matrix2 reference passed in argument.

Parameters

matrix:Matrix2 — The matrix to fill the current matrix.

setByVector()method 
public function setByVector(v1:Vector2, v2:Vector2):void

Sets the specified matrix with the two passed-in Vector2 objects. The first vector is the first column of the matrix and the second the other.

Parameters

v1:Vector2
 
v2:Vector2

setEntry()method 
public function setEntry(x:Number, y:Number, value:*):void

Sets matrix[x][y] with the specified value.

Example :

         import graphics.geom.Matrix2 ;
         var m:Matrix2 = new Matrix2( 1, 2, 3, 4 ) ;
         m.setEntry( 1 , 0 , 5 ) ; // [Matrix2:[1,2],[5,4]]
         trace( m ) ;
         

Parameters

x:Number
 
y:Number
 
value:*

toArray()method 
public function toArray():Array

Returns the Array representation of this instance.

Example :

         import graphics.geom.Matrix2 ;
         var m:Matrix2 = new Matrix2( 1, 2, 3, 4 ) ;
         var a:Array = m.toArray() ;
         trace( m + " toArray() : [" + a.join(",") + "]" ) ;
         

Returns
Array — the Array representation of this instance.
toObject()method 
public function toObject():Object

Returns the Object representation of this object.

Example :

         import graphics.geom.Matrix2 ;
         import system.eden ;
         var m:Matrix2 = new Matrix2( 1, 2, 3, 4 ) ;
         var o:Object = m.toObject() ;
         trace( m + " toObject() : " + eden.serialize(o) ) ;
         

Returns
Object — the Object representation of this object.
toSource()method 
public function toSource(indent:int = 0):String

Returns the source code string representation of the object.

Example :

         import graphics.geom.Matrix2 ;
         import system.eden ;
         var m:Matrix2 = new Matrix2( 1, 2, 3, 4 ) ;
         trace( m + " toSource() : " + m.toSource() ) ; // new graphics.geom.Matrix2(1,2,3,4)
         

Parameters

indent:int (default = 0)

Returns
String — the source code string representation of the object.
toString()method 
public function toString():String

Returns the string representation of the object.

Returns
String — the string representation of the object.