mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Fix issues in Point#isOrthogonal() and Point#isColinear()
This commit is contained in:
parent
78a107da65
commit
fe146c5ec0
1 changed files with 2 additions and 2 deletions
|
@ -709,7 +709,7 @@ var Point = Base.extend(/** @lends Point# */{
|
||||||
* @returns {Boolean} {@true it is colinear}
|
* @returns {Boolean} {@true it is colinear}
|
||||||
*/
|
*/
|
||||||
isColinear: function(point) {
|
isColinear: function(point) {
|
||||||
return this.cross(point) < /*#=*/ Numerical.TOLERANCE;
|
return Math.abs(this.cross(point)) < /*#=*/ Numerical.TOLERANCE;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -720,7 +720,7 @@ var Point = Base.extend(/** @lends Point# */{
|
||||||
* @returns {Boolean} {@true it is orthogonal}
|
* @returns {Boolean} {@true it is orthogonal}
|
||||||
*/
|
*/
|
||||||
isOrthogonal: function(point) {
|
isOrthogonal: function(point) {
|
||||||
return this.dot(point) < /*#=*/ Numerical.TOLERANCE;
|
return Math.abs(this.dot(point)) < /*#=*/ Numerical.TOLERANCE;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue