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

Re: [IMP-users] Rotations and Euler angles - possibly wrong documentation/function names



Sorry about the confusion. The Euler angle support has been added in a fairly ad hoc manner and is not extremely coherent or consistent. I think part of this is intrinsic to Euler angles as there are lots of conventions used in different places. You can see some more discussion about what to do with them at <https://github.com/salilab/imp/issues/303>. We didn't really come to any solid consensus on where to go.


On Mon, Jul 15, 2013 at 6:59 AM, Dan Cohen <" target="_blank">> wrote:
Hello all,

Please refer to Rotation3D.h
I add my remarks, all starting by XXXXXX :


/** \name Euler Angles
ÂÂÂ There are many conventions for how to define Euler angles, based on choices
ÂÂÂ of which of the x,y,z axis to use in what order and whether the rotation
ÂÂÂ axis is in the body frame (and hence affected by previous rotations) or in
ÂÂÂ in a fixed frame. See
ÂÂÂ http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
ÂÂÂ for a general description.

ÂÂÂ - All Euler angles are specified in radians.
ÂÂÂ - The names are all \c rotation_from_{fixed/body}_abc() where abc is the
ÂÂÂ ordering of x,y,z.
ÂÂÂ @{
*/

XXXXXX According to that, functions with the word "fixed" in their name should
XXXXXX Use the Lab fixed axis for rotations and NOT the new axis.

//! Initialize a rotation in x-y-z order from three angles
/** \param[in] xr Rotation around the X axis in radians
ÂÂÂ \param[in] yr Rotation around the Y axis in radians
ÂÂÂ \param[in] zr Rotation around the Z axis in radians
ÂÂÂ \note The three rotations are represented in the original (fixed)
ÂÂÂ coordinate frame.
ÂÂÂ See Rotation3D
ÂÂÂ See FixedXYZ
*/
IMPALGEBRAEXPORT Rotation3D get_rotation_from_fixed_xyz(double xr, double yr,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ double zr);

XXXXXX The above function complies with the above rule

//! Initialize a rotation from euler angles
/**
ÂÂ \param[in] phiÂÂ Rotation around the Z axis in radians
ÂÂ \param[in] theta Rotation around the X axis in radians
ÂÂ \param[in] psiÂÂ Rotation around the Z axis in radians
ÂÂ \note The first rotation is by an angle phi about the z-axis.
ÂÂ The second rotation is by an angle theta in [0,pi] about the
ÂÂ former x-axis , and the third rotation is by an angle psi
ÂÂ about the former z-axis.
ÂÂ See Rotation3D
*/
IMPALGEBRAEXPORT Rotation3D get_rotation_from_fixed_zxz(double phi,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ double theta,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ double psi);

XXXXXX I'm not sure what "former" means here, but probably this function complies too.
XXXXXX Don't understand why angle parameter names are so different here

//! Generate a rotation object from Euler Angles
/** \note The first rotation is by an angle about the z-axis.
ÂÂÂ The second rotation is by an angle about the new y-axis.
ÂÂÂ The third rotation is by an angle about the new z-axis.
ÂÂÂ \param[in] Rot First Euler angle (radians) defining the rotation (Z axis)
ÂÂÂ \param[in] Tilt Second Euler angle (radians) defining the rotation (Y axis)
ÂÂÂ \param[in] Psi Third Euler angle (radians) defining the rotation (Z axis)
ÂÂÂ See Rotation3D
ÂÂÂ See FixedZYZ
*/
IMPALGEBRAEXPORT Rotation3D get_rotation_from_fixed_zyz(double Rot, double Tilt,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ double Psi);

XXXXXX This function is also called fixed but clearly says it is using the NEW axis.


I'm confused and add to that , the fact that the results of these functions seem to be different than the ones produced by Chimera's rotate function so I'm in a problem here.

Thank you,
Dany


_______________________________________________
IMP-users mailing list
">
https://salilab.org/mailman/listinfo/imp-users