“Distance” (or angular magnitude) between two quaternions?

后端 未结 2 925
走了就别回头了
走了就别回头了 2021-02-06 10:23

I want to find the \"distance\" between two quaternions. By \"distance\" I mean a single float or int, not another quaternion (that would be the difference, i.e. inverse(q

相关标签:
2条回答
  • 2021-02-06 10:59

    Find the difference quaternion qd = inverse(q1)*q2).

    Than find the angle between q1 and q2 by angle = 2 * atan2(qd.vec().length(), qd.w()) // NOTE: signed

    The "angle" here, is the angle of rotation from q1 to q2 by shortest arc.

    0 讨论(0)
  • 2021-02-06 10:59

    Also you can use this lib function from pyquaternion. Quaternion.absolute_distance(q0, q1)

    0 讨论(0)
提交回复
热议问题