mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -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}
|
||||
*/
|
||||
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}
|
||||
*/
|
||||
isOrthogonal: function(point) {
|
||||
return this.dot(point) < /*#=*/ Numerical.TOLERANCE;
|
||||
return Math.abs(this.dot(point)) < /*#=*/ Numerical.TOLERANCE;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue