Refactor into geometry tree
This commit is contained in:
parent
f17710b0a4
commit
a81c477fab
6 changed files with 207 additions and 121 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue