Remove idiotic tolerance in Point2d::WithMagnitude(). What was I
thinking? [git-p4: depot-paths = "//depot/solvespace/": change = 1922]solver
parent
77cace05ce
commit
c128018c55
5
util.cpp
5
util.cpp
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue