(source, target)
return np.linalg.norm(quat_log(quat_product), axis=-1, keepdims=True)
Computes distance between source and target quaternions.

  This function assumes that both input arguments are unit quaternions.

  This function supports inputs with or without leading batch dimensions.

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

  Returns:
    Scalar representing the rotational distance from source to target.
Computes distance between source and target quaternions.
Computes distance between source and target quaternions .
def quat_dist(source, target):
  """Computes distance between source and target quaternions.

  This function assumes that both input arguments are unit quaternions.

  This function supports inputs with or without leading batch dimensions.

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

  Returns:
    Scalar representing the rotational distance from source to target.
  """
  quat_product = quat_mul(source, quat_inv(target))
  quat_product /= np.linalg.norm(quat_product, axis=-1, keepdims=True)
  return np.linalg.norm(quat_log(quat_product), axis=-1, keepdims=True)
def quat_dist ( source , target ) : quat_product = quat_mul ( source , quat_inv ( target ) ) quat_product /= np . linalg . norm ( quat_product , axis = - 1 , keepdims = True ) return np . linalg . norm ( quat_log ( quat_product ) , axis = - 1 , keepdims = True )