new approach to extreme miter points
This commit is contained in:
parent
065dd1d52b
commit
8cb0f37b26
3 changed files with 24 additions and 3 deletions
|
|
@ -44,6 +44,10 @@
|
|||
return [this.dx, this.dy, this.angle].join(',');
|
||||
};
|
||||
|
||||
PRO.clone = function() {
|
||||
return new Slope(null, null, this.dx, this.dy);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Slope} s
|
||||
* @returns {boolean}
|
||||
|
|
@ -70,6 +74,13 @@
|
|||
return this;
|
||||
};
|
||||
|
||||
PRO.invert = function() {
|
||||
this.dx = -this.dx;
|
||||
this.dy = -this.dy;
|
||||
this.angle = Math.atan2(this.dy, this.dx) * RAD2DEG;
|
||||
return this;
|
||||
}
|
||||
|
||||
PRO.toUnit = function() {
|
||||
let max = Math.max(ABS(this.dx), ABS(this.dy));
|
||||
this.dx = this.dx / max;
|
||||
|
|
|
|||
Loading…
Reference in a new issue