修改配置
This commit is contained in:
30
dist/Matrix2.js
vendored
Normal file
30
dist/Matrix2.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class Matrix2 {
|
||||
constructor() {
|
||||
this.el = [1, 0, 0, 1];
|
||||
}
|
||||
set(n11, n12, n21, n22) {
|
||||
let te = this.el;
|
||||
te[0] = n11;
|
||||
te[1] = n21;
|
||||
te[2] = n12;
|
||||
te[3] = n22;
|
||||
return this;
|
||||
}
|
||||
applyVector(vec) {
|
||||
let x = vec.x, y = vec.y;
|
||||
let e = this.el;
|
||||
vec.x = e[0] * x + e[2] * y;
|
||||
vec.y = e[1] * x + e[3] * y;
|
||||
return this;
|
||||
}
|
||||
setRotate(theta) {
|
||||
let el = this.el;
|
||||
let c = Math.cos(theta), s = Math.sin(theta);
|
||||
this.set(c, -s, s, c);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
exports.Matrix2 = Matrix2;
|
||||
//# sourceMappingURL=Matrix2.js.map
|
||||
Reference in New Issue
Block a user