Anton Gladky said: (by the date of Wed, 2 Jun 2010 07:32:59 +0200) > > - state->ori=Quaternionr(R_g2c); > > + state->ori=Quaternionr(R_g2c); state->ori.normalize(); > > > > > You cannot imagine, how many __hours__ I spent, trying to solve the problem
heh. in Lattice model I was using quaternions rather extensively. And I ended up adding .normalize after every second or third multiplication, because the numerical errors were building up quickly. I wish there was some flag telling the quaternion to be a UNIT quaternion. The library should take care of all that normalizing. After all inside its own routines it is calculating length quite frequently. Just add a check if != 1.0 and if so, then perform a .normalize action. this kind of "error" can be actually quite abundant all over the code. Might be interesting to try doing it always when returning from a wrapper call to quaternion multiplication and see if e.g. a triaxial results are different. -- 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

