code: def transformed(self, t):
          
          assert t.shape[0] == t.shape[1]
          extra_dimensions = t.shape[0] - self.dimensions - 1
  
          def transform(a):
              return t.dot(np.concatenate(
                  (a, [0] * extra_dimensions, [1]),
                  axis=0
              ))[:self.dimensions]
          return Rect(transform(self.mins), transform(self.maxes))
docs: Transforms an m-dimensional Rect using t, an nxn matrix that can
          transform vectors in the form: [x, y, z, …, 1].
          The Rect is padded to n dimensions.