(rmat)
return np.array([x, z, y])
Converts a 3x3 rotation matrix to XZY euler angles.
Converts a 3x3 rotation matrix to XZY euler angles.
Converts a 3x3 rotation matrix to XZY euler angles .
def _rmat_to_euler_xzy(rmat):
  """Converts a 3x3 rotation matrix to XZY euler angles."""
  if rmat[0, 1] > _POLE_LIMIT:
    logging.warning('Angle at North Pole')
    y = np.arctan2(rmat[1, 2], rmat[1, 0])
    z = -np.pi/2
    x = 0.0
    return np.array([x, z, y])

  if rmat[0, 1] < -_POLE_LIMIT:
    logging.warning('Angle at South Pole')
    y = np.arctan2(rmat[1, 2], rmat[1, 0])
    z = np.pi/2
    x = 0.0
    return np.array([x, z, y])

  y = np.arctan2(rmat[0, 2], rmat[0, 0])
  z = -np.arcsin(rmat[0, 1])
  x = np.arctan2(rmat[2, 1], rmat[1, 1])

  # order of return is the order of input
  return np.array([x, z, y])
def _rmat_to_euler_xzy ( rmat ) : if rmat [ 0 , 1 ] > _POLE_LIMIT : logging . warning ( 'Angle at North Pole' ) y = np . arctan2 ( rmat [ 1 , 2 ] , rmat [ 1 , 0 ] ) z = - np . pi / 2 x = 0.0 return np . array ( [ x , z , y ] ) if rmat [ 0 , 1 ] < - _POLE_LIMIT : logging . warning ( 'Angle at South Pole' ) y = np . arctan2 ( rmat [ 1 , 2 ] , rmat [ 1 , 0 ] ) z = np . pi / 2 x = 0.0 return np . array ( [ x , z , y ] ) y = np . arctan2 ( rmat [ 0 , 2 ] , rmat [ 0 , 0 ] ) z = - np . arcsin ( rmat [ 0 , 1 ] ) x = np . arctan2 ( rmat [ 2 , 1 ] , rmat [ 1 , 1 ] ) # order of return is the order of input return np . array ( [ x , z , y ] )