code: def transform_around(matrix, point):
      
      point = np.asanyarray(point)
      matrix = np.asanyarray(matrix)
      dim = len(point)
      if matrix.shape != (dim + 1,
                          dim + 1):
          raise ValueError('matrix must be (d+1, d+1)')
  
      translate = np.eye(dim + 1)
      translate[:dim, dim] = -point
      result = np.dot(matrix, translate)
      translate[:dim, dim] = point
      result = np.dot(translate, result)
  
      return result
docs: Given a transformation matrix, apply its rotation
      around a point in space.
  
      Parameters
      ----------
      matrix: (4,4) or (3, 3) float, transformation matrix
      point:  (3,) or (2,)  float, point in space
  
      Returns
      ---------
      result: (4,4) transformation matrix