(quat)
return quat_conj(quat) / np.sum(quat * quat, axis=-1, keepdims=True)
Return inverse of quaternion.

  This function supports inputs with or without leading batch dimensions.

  Args:
    quat: A quaternion [w, i, j, k].

  Returns:
    A quaternion representing the inverse of the original rotation.
Return inverse of quaternion.
Return inverse of quaternion .
def quat_inv(quat):
  """Return inverse of quaternion.

  This function supports inputs with or without leading batch dimensions.

  Args:
    quat: A quaternion [w, i, j, k].

  Returns:
    A quaternion representing the inverse of the original rotation.
  """
  # Ensure quat is an np.array in case a tuple or a list is passed
  quat = np.asarray(quat)
  return quat_conj(quat) / np.sum(quat * quat, axis=-1, keepdims=True)
def quat_inv ( quat ) : # Ensure quat is an np.array in case a tuple or a list is passed quat = np . asarray ( quat ) return quat_conj ( quat ) / np . sum ( quat * quat , axis = - 1 , keepdims = True )