def dosgeo(s, az, pl):
    """
    rotates  matrix a to az,pl returns  s
    Parameters
    __________
    s : [x11,x22,x33,x12,x23,x13] - the six tensor elements
    az : the azimuth of the specimen X direction
    pl : the plunge (inclination) of the specimen X direction

    Return
    s_rot : [x11,x22,x33,x12,x23,x13] - after rotation
    """
#
    a = s2a(s)  # convert to 3,3 matrix
#  first get three orthogonal axes
    X1 = dir2cart((az, pl, 1.))
    X2 = dir2cart((az + 90, 0., 1.))
    X3 = cross(X1, X2)
    A = np.transpose([X1, X2, X3])
    b = np.zeros((3, 3,), 'f')  # initiale the b matrix
    for i in range(3):
        for j in range(3):
            dum = 0
            for k in range(3):
                for l in range(3):
                    dum += A[i][k] * A[j][l] * a[k][l]
            b[i][j] = dum
    s_rot = a2s(b)  # afer rotation
    return s_rot