def euler_trans_matrix(etheta, elongan, eincl):
    """
    Get the transformation matrix R to translate/rotate a mesh according to
    euler angles.

    The matrix is

      R(long,incl,theta) =
        Rz(pi).Rz(long).Rx(incl).Rz(theta)
        Rz(long).Rx(-incl).Rz(theta).Rz(pi)

    where

      Rx(u) = 1,  0,        0
              0,  cos(u),   -sin(u)
              0,  sin(u),   cos(u)

      Ry(u) = cos(u),   0,  sin(u)
              0,        1,  0
              -sin(u),  0,  cos(u)

      Rz(u) = cos(u),   -sin(u),  0
              sin(u),   cos(u),   0
              0,        0,        1

    Rz(pi) = reflection across z-axis

    Note:

      R(0,0,0) = -1,  0,  0
                  0,  -1, 0
                  0,  0,  1

    :parameter float etheta: euler theta angle
    :parameter float elongan: euler long of asc node angle
    :parameter float eincl: euler inclination angle
    :return: matrix with size 3x3
    """

    s1 = sin(eincl);
    c1 = cos(eincl);
    s2 = sin(elongan);
    c2 = cos(elongan);
    s3 = sin(etheta);
    c3 = cos(etheta);
    c1s3 = c1*s3;
    c1c3 = c1*c3;

    return np.array([
                        [-c2*c3+s2*c1s3, c2*s3+s2*c1c3, -s2*s1],
                        [-s2*c3-c2*c1s3, s2*s3-c2*c1c3, c2*s1],
                        [s1*s3, s1*c3, c1]
                    ])