Definitions (following Evans, Acta Cryst. (2001), D57, 1355-1359)

Rotation matrix
---------------

             ( r11  r12  r13 )
R( x y z ) = ( r21  r22  r23 )
             ( r31  r32  r33 )

           ( x )    ( r11*x + r12*y + r13*z )
R( x y z ) ( y ) =  ( r21*x + r22*y + r23*z )
           ( z )    ( r31*x + r32*y + r33*z )


Polar angles (CCP4 convention)
------------------------------

phi:    the angle between the x-axis and the projection of the vector into the x,y plane.
omega:  inclination versus z axis
kappa:  rotation angle around rotation vector


Polar angles (CNS convention)
-----------------------------

phi:    the angle between the x-axis and the projection of the vector into the x,z plane.
psi:    inclination versus y axis
kappa:  rotation angle around rotation vector


Rotation vector/direction cosines (CCP4 convention)
---------------------------------------------------

( l )    ( sin(omega) cos(phi) )
( m ) =  ( sin(omega) sin(phi) ) 
( n )    (     cos(omega)      )

                   ( l**2+(m**2+n**2)cos(kappa)     lm(1-cos(kappa))-nsin(kappa)   nl(1-cos(kappa))+msin(kappa) )
R( l m n kappa ) = ( lm(1-cos(kappa))+nsin(kappa)   m**2+(l**2+n**2)cos(kappa)     mn(1-cos(kappa))-lsin(kappa) )
                   ( nl(1-cos(kappa))-msin(kappa)   mn(1-cos(kappa))+lsin(kappa)   n*2+(l**2+m**2)cos(kappa)    )


Rotation vector/direction cosines (CNS convention)
--------------------------------------------------

( l )    (   sin(psi) cos(phi) )
( m )    (        cos(psi)     )
( n ) =  ( - sin(psi) sin(phi) )


Eulerian angles (Crowther convention - CCP4/Amore)
--------------------------------------------------

rotate by gamma around z       then
rotate by beta  around new y   then
rotate by alpha around new z

cosa, cosb, cosg = cos(alpha), cos(beta), cos(gamma)
sina, sinb, sing = sin(alpha), sin(beta), sin(gamma)

R = Rz(alpha) Ry(beta) Rz(gamma) =

  ( cosa  -sina  0 ) (  cosb  0  sinb ) (  cosg  -sing  0 )
= ( sina   cosa  0 ) (   0    1    0  ) (  sing   cosg  0 )  = 
  (  0       0   1 ) ( -sinb  0  cosb ) (   0      0    1 )

  ( cosa cosb cosg - sina sing   -cosa cosb sing - sina cosg   cosa sinb )
= ( sina cosb cosg + cosa sing   -sina cosb sing + cosa cosg   sina sinb )
  (        - sinb cosg                    sinb sing               cosb   )


Sometimes the rotation with the reverse order of angles:

rotate by alpha around z       then
rotate by beta  around new y   then
rotate by gamma around new z

is mentioned in the CCP4 manual. This rotation IS NOT equivalent to the original
convention. 



Eulerian angles (Rossmann & Blow convention)
--------------------------------------------

This is the convention by Rossmann & Blow, Acta Cryst. (1962), 15, 24.
The rotation matrix given in the paper represents the transposed 
of the matrix employed in the rotation server, i.e. the inversed rotation. 
The inversed matrix reported in the Rossmann & Blow paper corresponds to 
rotations about negative theta1, theta2, theta3 in reversed order.

rotate by theta3 around z       then
rotate by theta2 around new x   then
rotate by theta1 around new z

R = Rz(theta1) Rx(theta2) Rz(theta3) =

( cost1  -sint1  0 ) ( 1    0       0   ) (  cost3  -sint3  0 )
( sint1   cost1  0 ) ( 0  cost2  -sint2 ) (  sint3   cost3  0 )
(   0       0    1 ) ( 0  sint2   cost2 ) (    0       0    1 )

( cost1 cost3 - sint1 cost2 sint3  -cost1 sint3 - sint1 cost2 cost3   sint1 sint2 )
( sint1 cost3 + cost1 cost2 sint3  -sint1 sint3 + cost1 cost2 cost3  -cost1 sint2 )
(          sint2 sint3                       sint2 cost3                 cost2    )

theta1  =  alpha + 90º
theta2  =  beta
theta3  =  gamma - 90º


Eulerian angles (XPLOR/CNS convention)
--------------------------------------

Eulerian angles in XPLOR/CNS describe the same operations as in the 
Rossman & Blow convention. However, the operations are applied in 
REVERSE order. 

rotate by theta1' around z       then
rotate by theta2' around new x   then
rotate by theta3' around new z

R = Rz(theta1') Ry(theta2') Rz(theta1') =

( cost3'  -sint3'  0 ) ( 1     0       0    ) (  cost1'  -sint1'  0 )
( sint3'   cost3'  0 ) ( 0   cost2'  sint2' ) (  sint1'   cost1'  0 ) =
(   0        0     1 ) ( 0  -sint2'  cost2' ) (    0        0     1 )

( cost1 cost3 - sint1 cost2 sint3  -sint1 cost3 - cost1 cost2 sint3  -sint2 sint3 )
( cost1 sint3 + sint1 cost2 cost3  -sint1 sint3 + cost1 cost2 cost3   sint2 cost3 )
(          -sint1 sint2                      -cost1 sint2                 cost2   )


theta1'  =  270º - gamma = 180º - theta3
theta2'  =  beta         = theta2
theta3'  =  90º - alpha  = 180º - theta1


Lattman angles (CNS)
--------------------

theta+ = theta1' + theta3'
theta  = theta2'
theta- = theta1' - theta3'