code: def axis_angle_to_rotation_matrix(v, theta):
      
      if np.abs(theta) < np.spacing(1):
          return np.eye(3)
      else:
          v = v.reshape(3,1)
          np.testing.assert_almost_equal(np.linalg.norm(v), 1.)
          vx = np.array([[0, -v[2], v[1]],
                         [v[2], 0, -v[0]],
                         [-v[1], v[0], 0]])
          vvt = np.dot(v, v.T)
          R = np.eye(3)*np.cos(theta) + (1 - np.cos(theta))*vvt + vx * np.sin(theta)
          return R
docs: Convert rotation from axis-angle to rotation matrix
      
          Parameters
      ---------------
      v : (3,) ndarray
              Rotation axis (normalized)
      theta : float
              Rotation angle (radians)
  
      Returns
      ----------------
      R : (3,3) ndarray
              Rotation matrix