Search code examples
matlabmatrixlinear-algebrarotatetransformeuler-angles

Euler angles from a 2x2 ZYZ rotation matrix?


How I can find the euler angles from a random 2x2 ZYZ rotation matrix? We know that all SU(2) matrices can be decomposed, using the ZYZ decomposition, as a three matrices product based in euler angles. In the Wikipedia about euler angles:

"A similar three angle decomposition applies to SU(2), the special unitary group of rotations in complex 2D space, with the difference that β ranges from 0 to 2π. These are also called Euler angles."

I have did try do a equations system in the matlab, but it found the solution in some cases (pauli matrices) and in many other not. It never find to a random SU(2) matrix.

Anybody know a general approach? I already did found how to do 3x3 matrices, but not for 2x2 ZYZ.

Best regards!


Solution

  • from https://groups.google.com/forum/?fromgroups=#!topic/mathtools/q25a5WoG6Eo, written by Haifeng GONG (didn't you find it by yourself):

    function orthm = ang2orth(ang) 
    
    sa = sin(ang(2)); ca = cos(ang(2)); 
    sb = sin(ang(1)); cb = cos(ang(1)); 
    sc = sin(ang(3)); cc = cos(ang(3)); 
    
    ra = [  ca,  sa,  0; ... 
           -sa,  ca,  0; ... 
             0,   0,  1]; 
    rb = [  cb,  0,  sb; ... 
             0,  1,  0; ... 
           -sb,  0,  cb]; 
    rc = [  1,   0,   0; ... 
            0,   cc, sc;... 
            0,  -sc, cc]; 
    orthm = rc*rb*ra; 
    
    function ang = orth2ang(orthm) 
    ang(1) = asin(orthm(1,3)); %Wei du 
    ang(2) = angle( orthm(1,1:2)*[1 ;i] ); %Jing Du 
    yz = orthm* ... 
        [orthm(1,:)',... 
         [-sin(ang(2)); cos(ang(2)); 0],... 
         [-sin(ang(1))*cos(ang(2)); -sin(ang(1)*sin(ang(2))); 
    cos(ang(1))] ]; 
    
    ang(3) = angle(yz(2,2:3)* [1; i]); % Xuan Du 
    

    As can be seen here and here There is an isomorphism between SO(3) and SU(2):

    enter image description here