Trying to understand the rotation matrix #68
Replies: 3 comments 2 replies
-
It seems that the rotation matrix matches the one described here:
If so the euler array is |
Beta Was this translation helpful? Give feedback.
-
The system of euler angles commonly used in optical design programs (Zemax, CODE V, Oslo, etc) is comprised of rotations in this order:
Interestingly, Spencer and Murty have alpha and beta reversed. Spencer was the author of ACCOS V: Oslo is a "next generation" version of ACCOS and CODE V adopted the coordinate systems used by ACCOS in the late '70s. But I digress... The author of the transforms3d package that I use to build the matrix from the angles differentiates between extrinsic and intrinsic euler angles. The former reference the rotations to a fixed XYZ axis, the latter has the coordinate system moving after each rotation about an axis. Optical design software use the intrinsic, moving coordinate system with euler angles. Given that, I have a question about the call euler2mat. It uses the default axes sequence which is 'sxyz'. This is for the explicit euler rotations. The implicit ones would be 'rxyz'. Fortunately all models I've seen that have tilts and decenters have tilts that are alpha tilts, i.e. always in the YZ plane. For this case of only alpha tilt, the euler2mat function generates the same rotation matrix. So an axes='rxyz' needs to be added to the call to euler2mat in surface.py. The convertl2r function converts the angle sign convention used by CODE V (and documented in their Prompting Guide) to the right-handed convention used by transforms3d. Both the rotation about x and y axes are left-handed in CODE V. It is a little known aspect of rotation matrices that an intrinsic matrix of 3 angles is equal to the extrinsic matrix with the angles taken in the reverse order, i.e. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed reply. I am still trying to get my head around rotations; this is one area that I struggle with. |
Beta Was this translation helpful? Give feedback.
-
Hi Mike
I was checking what happens in this line of code:
So I stepped in the
euler2mat
implementation.Unfortunately the calculations done here don't match what I get from other implementations - nor does it seem to match https://mathworld.wolfram.com/EulerAngles.html or the Spencer / Murty paper.
I was wondering if you could shed some light on the treatment of euler angles and what conventions are being used.
Beta Was this translation helpful? Give feedback.
All reactions