Refactor into geometry tree

This commit is contained in:
be5invis 2021-02-27 21:01:20 -08:00
parent f17710b0a4
commit a81c477fab
6 changed files with 207 additions and 121 deletions

View file

@ -14,6 +14,10 @@ module.exports = class Transform {
return new Transform(1, 0, 0, 1, 0, 0);
}
static Translate(x, y) {
return new Transform(1, 0, 0, 1, x, y);
}
apply(pt) {
return {
x: pt.x * this.xx + pt.y * this.yx + this.x,