code: def R_rot_2d(th):
      
      s, = np.sin(th).T
      c, = np.cos(th).T
      R = np.empty((len(th), 2, 2), dtype=np.float)
  
      R[:, 0, 0] = c
      R[:, 0, 1] = -s
  
      R[:, 1, 0] = s
      R[:, 1, 1] = c
  
      return R
docs: Return a 2-dimensional rotation matrix.
  
      Parameters
      ----------
      th: array, shape (n, 1)
          Angles about which to rotate.
  
      Returns
      -------
      R: array, shape (n, 2, 2)