# Matrix

Module hilo/geom/Matrix Requires hilo/core/Class Source Matrix.js
Matrix class is a transforming matrix, which declare how points in one coordinate maped to another coordinate.

### Methods

| Method | Defined
--- | --- | ---
| Matrix(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number) Constructor | Matrix
| clone():Matrix clone | Matrix
| concat(mtx:Matrix):Matrix Link a Matrix to current Matrix, in order to make geometry effects on these two composed more effective. | Matrix
| copy(mat:Matrix):Matrix copy | Matrix
| identity():Matrix Set each Matrix property a value to trigger null transform. | Matrix
| invert():Matrix Apply an invert transformation of original Matrix. | Matrix
| rotate(angle:Number):Matrix Rotate the Matrix Object. | Matrix
| scale(sx:Number, sy:Number):Matrix Scale the Matrix. | Matrix
| set(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number) set | Matrix
| transformPoint(point:Object, round:Boolean, returnNew:Boolean):Object Return the result after apply a Matrix displaying transform on the point. | Matrix
| translate(dx:Number, dy:Number):Matrix Translate the Matrix alongside x axis and y axis by dx and dy. | Matrix

### Constructor

Matrix(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number)

parameters
a:Number — The value affects pixel positioning alongside the x axis when Scale or rotate images.
b:Number — The value affects pixel positioning alongside the y axis when rotate or skew images.
c:Number — The value affects pixel positioning alongside the x axis when rotate or skew images.
d:Number — The value affects pixel positioning alongside the y axis when Scale or rotate images.
tx:Number — The distance to move every point alongside the x axis.
ty:Number — The distance to move every point alongside the y axis.

### Method Detail

clone():Matrix
clone

return
  Matrix —

concat(mtx:Matrix):Matrix
Link a Matrix to current Matrix, in order to make geometry effects on these two composed more effective.

parameters
mtx:Matrix — Matrix that link to the source matrix.

return
  Matrix — A Matrix Object.

copy(mat:Matrix):Matrix
copy

parameters
mat:Matrix —

return
  Matrix — this

identity():Matrix
Set each Matrix property a value to trigger null transform. The Matrix after applying identity matrix transformation will be exactly the same as original.

return
  Matrix — A Matrix object.

invert():Matrix
Apply an invert transformation of original Matrix. Using this invert transformation, you can reset a Matrix to a state before it had been apply some Matrix.

return
  Matrix — A Matrix object.

rotate(angle:Number):Matrix
Rotate the Matrix Object.

parameters
angle:Number — The angle to rotate.

return
  Matrix — A Matrix object.

scale(sx:Number, sy:Number):Matrix
Scale the Matrix.

parameters
sx:Number — The value to multiply those object scale alongside the x axis.
sy:Number — The value to multiply those object scale alongside the y axis.

return
  Matrix — A Matrix object.

set(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number)
set

parameters
a:Number —
b:Number —
c:Number —
d:Number —
tx:Number —
ty:Number —

transformPoint(point:Object, round:Boolean, returnNew:Boolean):Object
Return the result after apply a Matrix displaying transform on the point.

parameters
point:Object — Point need to transform.
round:Boolean — Whether ceil the coordinate values of the point.
returnNew:Boolean — Whether return a new point.

return
  Object — 由应用矩阵转换所产生的点。

translate(dx:Number, dy:Number):Matrix
Translate the Matrix alongside x axis and y axis by dx and dy.

parameters
dx:Number — Translate Matrix alongside the x axis to the right (measured in px).
dy:Number — Translate Matrix alongside the y axis to the right (measured in px).

return
  Matrix — A Matrix object.