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

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

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

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