EMsoft-org / EMsoft

Public EMsoft repository
Other
61 stars 94 forks source link

rotations.f90 #96

Closed saransh13 closed 3 years ago

saransh13 commented 4 years ago

Two issues I noticed, both for the case of eu = (pi, pi, pi/2)

  1. the single and double version of eu2ax gives different signs of the axis single version returns (-1/sqrt(2), -1/sqrt(2), 0, pi) double version returns (1/sqrt(2), 1/sqrt(2), 0, pi)

  2. for these Euler angles, successive operations of eu2ax followed by ax2eu returns (pi/2, pi, 0). If these Euler angles are used to generate the rotation matrix, then it agrees with the rotation matrix corresponding to the other euler angle, which is the way its implemented in MODRotationsTest. However, the axis-angle pair (and therefore quaternions, Rodrigues vector etc. do not agree, and differ in sign of the rotations axis).

All of the came up in my implementation of the exponential map orientation representation and implementing the pair wise and triple tests.

marcdegraef commented 4 years ago

Well, since (pi,pi,pi/2) lies in the Phi=pi plane, that rotation is completely degenerate, and is equivalent to, among an infinitude of others, (pi/2,pi,0); in fact, all the rotations of the type (pi+x,pi,pi/2+x) are equivalent. The case you mention in item 2. has x=-pi/2. So it becomes a matter of preference to decide which one to return when doing a pairwise test.

I'll put item 1 on my list of things to check; fixing that might automatically fix 2 as well.

marcdegraef commented 3 years ago

item 1 is fixed.