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

[IMP-dev] Fwd: FixedZYZ fixed_zyz_from_rotation



2010/1/30 Daniel Russel <>:
> 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).

Yes, I think that is what is happening here, but I don't know how to repair it.

How does the
> instability manifest itself.

When psi is 0, then sin(psi) = 0 and you're dividing by it. Needs a
check, that is what I did. Does it help?

>
> I'll try to look more into it later.
>
>
> On Jan 29, 2010, at 8:46 PM, Javier Ángel Velázquez Muriel
> <> 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
>
> _______________________________________________
> IMP-dev mailing list
> 
> https://salilab.org/mailman/listinfo/imp-dev
>