Further cleanup and optimize spiro expansion.

This commit is contained in:
be5invis 2020-06-19 19:46:32 -07:00
parent e86890e16a
commit e1e8144f1c
12 changed files with 234 additions and 224 deletions

View file

@ -20,6 +20,12 @@ module.exports = class Transform {
y: pt.x * this.xy + pt.y * this.yy + this.y
};
}
applyOffset(delta) {
return {
x: delta.x * this.xx + delta.y * this.yx,
y: delta.x * this.xy + delta.y * this.yy
};
}
unapply(pt) {
const xx = pt.x - this.x;
const yy = pt.y - this.y;