1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A Angle between two quaternions

  1. Apr 11, 2016 #1

    I have two quaternions with norm equal to 1. Both are represented in the angle-phase form, i.e, I have q=exp(i*\phi)exp(k*\psi)exp(j*\theta) and p=exp(i*\phi')exp(k*\psi')exp(j*\theta'). Let \alpha be the angle between q and p. I need to write \alpha in function of \phi-\phi', \psi-\psi' and \theta-\theta' in a simple way. Could anyone give me some idea?
  2. jcsd
  3. Apr 11, 2016 #2


    User Avatar
    Gold Member

    In any vector space, ##A\cdot B = |A||B|cos(\theta)## with theta the angle between two vectors and ##\cdot## the inner product.
    A quick google search gives this:
    https://www.researchgate.net/post/How_do_I_calculate_the_smallest_angle_between_two_quaternions [Broken]
    Which says use the dot product.
    Last edited by a moderator: May 7, 2017
  4. Apr 11, 2016 #3
    The "inner product" would be good for me if p and q were in Cartesian form. My problem is that I need to write \alpha in function of \phi-\phi', \psi-\psi' and \theta-\theta' in a simple way. The quartenions q and p are in the phase-angle form and I can not convert the quaternions to the Cartesian form. This is my challenge!

  5. Apr 11, 2016 #4


    User Avatar
    Gold Member

  6. Apr 21, 2016 #5
    I assume by Angle-Phase-Form you mean the polar decomposition as in here:

    You still need an rotation angle for each quaternion (you only gave 3 components, but you need still need the angle).
    Be aware that the actual rotation angle is [itex]2 \cdot \theta[/itex]!


    I don't have a good answer, but what you need is related to the angle used in a Quaternion Slerp
    You might find "2. Relationship of Quaternions to Rotations" useful in that document.

    Here is some code by James McEnnan I use in my own project to get the angle and the eigen-axis (rotation axis) between two quaternions, see function getang here:
    Be aware that in this code [0],[1],[2] are the vector parts of the quaternions and [3] is the scalar part.

    I know this is not the form you have, but maybe it will be of some use to you.
    Last edited by a moderator: Apr 21, 2016
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted