From c128018c55ffe28b99aa97ffb9c8cf9e8f3ca792 Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Sun, 1 Mar 2009 21:52:08 -0800 Subject: [PATCH] Remove idiotic tolerance in Point2d::WithMagnitude(). What was I thinking? [git-p4: depot-paths = "//depot/solvespace/": change = 1922] --- util.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util.cpp b/util.cpp index f71fae5d..8a02d70e 100644 --- a/util.cpp +++ b/util.cpp @@ -713,11 +713,12 @@ double Point2d::Magnitude(void) { Point2d Point2d::WithMagnitude(double v) { double m = Magnitude(); - if(m < 0.001) { + if(m < 1e-20) { + dbp("!!! WithMagnitude() of zero vector"); Point2d r = { v, 0 }; return r; } else { - return ScaledBy(v/Magnitude()); + return ScaledBy(v/m); } }