[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-dev] FixedZYZ fixed_zyz_from_rotation



Check that the choice of Euler angles isn't singular near that point (each choice of Euler angles has a place where it is singular, meaning very different Euler angle values produce almost the same rotation). How does the instability manifest itself.

I'll try to look more into it later.


On Jan 29, 2010, at 8:46 PM, Javier Ãngel VelÃzquez Muriel <javi@salilab.o rg> wrote:

That function enters into numerical instability when
sin_tilt_sin_psi==0, which produces psi ==0. I've tried to fixe it,
and i think is correct, but now the code throws the exception. The
input and output are "apart". Can anybody help me to fix it? Anything
that I missed?

 double psi= std::atan2(sin_tilt_sin_psi, cos_psi_sin_tilt);
 if(almost_equal(sin_tilt_sin_psi,0,1e-6)) {
   double sin_tilt= 0;
   double tilt= std::atan2(sin_tilt, cos_tilt);
 } else {
   double sin_tilt= sin_tilt_sin_psi/std::sin(psi);
   double tilt= std::atan2(sin_tilt, cos_tilt);
 }
//  double cos_rot= cos_rot_sin_tilt/sin_tilt;
//  double sin_rot= sin_rot_sin_tilt/sin_tilt;
//  double rot= std::atan2(sin_rot, cos_rot);
   double rot= std::atan2(sin_rot, cos_rot);
_______________________________________________
IMP-dev mailing list

https://salilab.org/mailman/listinfo/imp-dev