From fe146c5ec00cb6d3bdf971d4a170b205f1524617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 28 Feb 2014 17:57:09 +0100 Subject: [PATCH] Fix issues in Point#isOrthogonal() and Point#isColinear() --- src/basic/Point.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/Point.js b/src/basic/Point.js index 04665722..8714e417 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -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; }, /**