ht.Math.Matrix2d(r, tx, ty, sx, sy)

new Matrix2d(r, tx, ty, sx, sy)

2d matrix

Parameters:
Name Type Attributes Description
r number <optional>
tx number <optional>
ty number <optional>
sx number <optional>
sy number <optional>

Members

a :number

b :number

c :number

d :number

tx :number

ty :number

Methods

append(mat) → {ht.Math.Matrix2d}

this = this. * mat;

Parameters:
Name Type Description
mat ht.Math.Matrix2d
Returns:
ht.Math.Matrix2d

appendRotate(angle) → {ht.Math.Matrix2d}

| a c tx | | cos -sin 0 |
| b d ty | | sin cos 0 |

Parameters:
Name Type Description
angle number
Returns:
ht.Math.Matrix2d

appendScale(x, y) → {ht.Math.Matrix2d}

| a c tx | | x 0 0 |
| b d ty | | 0 y 0 |

Parameters:
Name Type Description
x number
y number
Returns:
ht.Math.Matrix2d

appendTranslate(x, y) → {ht.Math.Matrix2d}

| a c tx | | 1 0 x |
| b d ty | | 0 1 y |

Parameters:
Name Type Description
x number
y number
Returns:
ht.Math.Matrix2d

apply(point, newPoint) → {Point}

矩阵应用到 point 上
| a c tx | | x |
| b d ty | | y |

Parameters:
Name Type Attributes Description
point Point | ht.Math.Vector2
newPoint Point | ht.Math.Vector2 <optional>
Returns:
Point

applyInverse(point, newPoint) → {Point}

逆矩阵应用到 point 上
| a c tx |-1 | x |
| b d ty | | y |

Parameters:
Name Type Attributes Description
point Point
newPoint Point <optional>
Returns:
Point

clone() → {ht.Math.Matrix2d}

创建一个相同的矩阵

Returns:
ht.Math.Matrix2d -

新矩阵

copy(Matrix2d) → {ht.Math.Matrix2d}

将矩阵 Matrix2d 的元素复制到当前矩阵中

Parameters:
Name Type Description
Matrix2d ht.Math.Matrix2d
Returns:
ht.Math.Matrix2d

decompose() → {Object}

将矩阵解析成 translate、rotation、scale 数据

Returns:
Object

fromArray(Array) → {ht.Math.Matrix2d}

使用列优先数组来设置当前矩阵

Parameters:
Name Type Description
Array Array.<Object>

矩阵列优先数组

Returns:
ht.Math.Matrix2d

identity() → {ht.Math.Matrix2d}

将当前矩阵重置为单位矩阵

Returns:
ht.Math.Matrix2d

invert() → {ht.Math.Matrix2d}

矩阵翻转

Returns:
ht.Math.Matrix2d

prepend(mat) → {ht.Math.Matrix2d}

this = mat * this;

Parameters:
Name Type Description
mat ht.Math.Matrix2d
Returns:
ht.Math.Matrix2d

rotate(r) → {any}

在当前值基础上设置旋转值

Parameters:
Name Type Description
r number
Returns:
any

scale(x, y) → {ht.Math.Matrix2d}

在当前值基础上增加缩放值

Parameters:
Name Type Description
x number
y number
Returns:
ht.Math.Matrix2d

set(a, b, c, d, tx, ty) → {ht.Math.Matrix2d}

设置矩阵信息

Parameters:
Name Type Description
a number
b number
c number
d number
tx number
ty number
Returns:
ht.Math.Matrix2d

setFromTransform(angle, cx, cy, sx, sy) → {ht.Math.Matrix2d}

将变换数据转换成矩阵数据

Parameters:
Name Type Description
angle number
cx number
cy number
sx number
sy number
Returns:
ht.Math.Matrix2d

tf(x, y) → {Point}

| a c tx | | x |
| b d ty | | y |

Parameters:
Name Type Attributes Description
x number | Point
y number <optional>
Returns:
Point

tfi(x, y) → {Point}

| a c tx |-1 | x |
| b d ty | | y |

Parameters:
Name Type Attributes Description
x number | Point
y number <optional>
Returns:
Point

toArray() → {Array.<number>}

使用列优先格式将此矩阵的元素写入数组中

Returns:
Array.<number>

toArray9() → {Array.<number>}

将矩阵转换成 3 * 3,并使用列优先格式将此矩阵的元素写入数组中

Returns:
Array.<number> -

[ a, b, 0, c, d, 0, tx, ty, 1]

transform(mat) → {ht.Math.Matrix2d}

this = mat * this;

Parameters:
Name Type Description
mat ht.Math.Matrix2d
Returns:
ht.Math.Matrix2d

translate(x, y) → {ht.Math.Matrix2d}

在当前值基础上增加水平和垂直平移值

Parameters:
Name Type Description
x number
y number
Returns:
ht.Math.Matrix2d