code: def Tmatrix(X):
      
      T = [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]
      for row in X:
          for k in range(3):
              for l in range(3):
                  T[k][l] += row[k] * row[l]
      return T
docs: gets the orientation matrix (T) from data in X