Fix issues in Point#isOrthogonal() and Point#isColinear()

This commit is contained in:
Jürg Lehni 2014-02-28 17:57:09 +01:00
parent 78a107da65
commit fe146c5ec0

View file

@ -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;
}, },
/** /**