quaternion.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:hand_eye_calibration 作者: ethz-asl 项目源码 文件源码
def __truediv__(self, other):
    """ Quaternion division with either scalars or quaternions.

    The division with a scalar returns the quaternion with all elements divided
    by the scalar.

    The division with a quaternion returns q = q1 / q2 = q1 * q2^-1.
    """
    if isinstance(other, Quaternion):
      return self * other.inverse()
    elif isinstance(other, Number):
      q = self.q.copy()
      q_out = q / np.float64(other)
      return Quaternion(q=q_out)
    else:
      assert False, "Division is only defined for scalars or quaternions."
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号