Remove idiotic tolerance in Point2d::WithMagnitude(). What was I

thinking?

[git-p4: depot-paths = "//depot/solvespace/": change = 1922]
solver
Jonathan Westhues 2009-03-01 21:52:08 -08:00
parent 77cace05ce
commit c128018c55
1 changed files with 3 additions and 2 deletions

View File

@ -713,11 +713,12 @@ double Point2d::Magnitude(void) {
Point2d Point2d::WithMagnitude(double v) { Point2d Point2d::WithMagnitude(double v) {
double m = Magnitude(); double m = Magnitude();
if(m < 0.001) { if(m < 1e-20) {
dbp("!!! WithMagnitude() of zero vector");
Point2d r = { v, 0 }; Point2d r = { v, 0 };
return r; return r;
} else { } else {
return ScaledBy(v/Magnitude()); return ScaledBy(v/m);
} }
} }