Janek Kozicki said: (by the date of Tue, 26 Oct 2010 18:40:50 +0200) > Bruno Chareyre said: (by the date of Tue, 26 Oct 2010 17:09:12 +0200) > > > Below is an example (from revno 2514). If somebody see an obvious reason > > for getting a NaN, please let me know; if not, I'll send this to Eigen > > (the first line should be enough).
> summarising: it is possible to obtain nan's, if toAxisAngle is not > taking care of corner cases, and if quaternion diverges too much > from identity. In your example numbers, the nan was coming from > arcus_cos(1.00001), which of course must be nan, since acos doesn't > accept arguments higher than 1.0 so, for example a function that calculates axis angle, coule do a check if that argument to acos is higher that 1.0. And if yes - then perform a normalization, to bring back down that quaternion to an identity quaternion. This method will prevent quaternions from growin bigger than indentity, but will not catch quaternions that get smaller than identity - and that should be prevented too somehow (but will not produce NaNs). -- Janek Kozicki http://janek.kozicki.pl/ | _______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

