code: def planar_matrix(offset=None,
                    theta=None,
                    point=None):
      
      if offset is None:
          offset = [0.0, 0.0]
      if theta is None:
          theta = 0.0
      offset = np.asanyarray(offset, dtype=np.float64)
      theta = float(theta)
      if not np.isfinite(theta):
          raise ValueError('theta must be finite angle!')
      if offset.shape != (2,):
          raise ValueError('offset must be length 2!')
  
      T = np.eye(3, dtype=np.float64)
      s = np.sin(theta)
      c = np.cos(theta)
  
      T[0, 0:2] = [c, s]
      T[1, 0:2] = [-s, c]
      T[0:2, 2] = offset
  
      if point is not None:
          T = transform_around(matrix=T, point=point)
  
      return T
docs: 2D homogeonous transformation matrix
  
      Parameters
      ----------
      offset : (2,) float
        XY offset
      theta : float
        Rotation around Z in radians
      point :  (2, ) float
        point to rotate around
  
      Returns
      ----------
      matrix : (3, 3) flat
        Homogenous 2D transformation matrix