> De : Tanguy Yannick [mailto:[email protected]]
> About the default value (1e-14), I know the tolerance is case-
> dependant, but some times, we don't precisely know the order of
> magnitude (ex : jacobians matrices) and it's quite practical to have a
> default value.
Hi,
A point of the discussion with Gilles in the MATH-863 (new Quaternion class) is
about this magic 1E-14. ;)
Consider the following methods:
public Quaternion normalize() {
final double norm = getNorm();
if (norm >= Precision.SAFE_MIN) {
return new Quaternion(q0 / norm, q1 / norm, q2 / norm, q3 / norm);
} else {
throw new ZeroException();
}
}
public boolean isUnitQuaternion() {
final double norm = getNorm();
if (Precision.equals(norm, 1.0, Precision.EPSILON)) {
return true;
} else {
return false;
}
}
=> There are many cases where
myQuaternion.normalize().isUnitQuaternion()
returns "false".
The Precision.EPSILON is too small. That's why we use this "historical"
arbitrary tolerance of 1E-14.
Do you think that adding a tolerance parameter in this method
isUnitQuaternion() (and in its neighboors) is a good idea ?
Julien
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]