API / Matrix
类: Matrix
定义于: geom/Matrix.ts:31
2D 转换矩阵。
属性
a
ts
a: number;
定义于: geom/Matrix.ts:40
缩放或旋转图像时影响像素沿 x 轴定位的值。
默认值
ts
1.0
b
ts
b: number;
定义于: geom/Matrix.ts:49
旋转或倾斜图像时影响像素沿 y 轴定位的值。
默认值
ts
0.0
c
ts
c: number;
定义于: geom/Matrix.ts:58
旋转或倾斜图像时影响像素沿 x 轴定位的值。
默认值
ts
0.0
d
ts
d: number;
定义于: geom/Matrix.ts:67
缩放或旋转图像时影响像素沿 y 轴定位的值。
默认值
ts
1.0
tx
ts
tx: number;
定义于: geom/Matrix.ts:76
沿 x 轴平移每个点的距离。
默认值
ts
0.0
ty
ts
ty: number;
定义于: geom/Matrix.ts:85
沿 y 轴平移每个点的距离。
默认值
ts
0.0
方法
concat()
ts
concat(value: Matrix): Matrix;
定义于: geom/Matrix.ts:157
将当前矩阵与另一个矩阵相乘。
参数
参数 | 类型 | 描述 |
---|---|---|
value | Matrix | 需要相乘的矩阵。 |
返回
Matrix
identity()
ts
identity(): Matrix;
定义于: geom/Matrix.ts:140
转换为单位矩阵。 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。
返回
Matrix
invert()
ts
invert(): Matrix;
定义于: geom/Matrix.ts:195
转换为逆矩阵。
返回
Matrix
toString()
ts
toString(): string;
定义于: geom/Matrix.ts:102
返回
string
transformPoint()
ts
transformPoint(
x: number,
y: number,
result: object,
delta: boolean): void;
定义于: geom/Matrix.ts:256
将矩阵转换应用于特定点。
参数
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
x | number | undefined | 横坐标。 |
y | number | undefined | 纵坐标。 |
result | { x : number ; y : number ; } | undefined | 应用转换之后的点。 |
result.x | number | undefined | - |
result.y | number | undefined | - |
delta | boolean | false | 是否忽略 tx,ty 对点的转换。 |
返回
void