Finding the Angle Between Two Quaternions: A Simple Solution?

In summary, the conversation discusses the calculation of the angle between two quaternions with norm equal to 1, represented in the angle-phase form. The question is asked whether there is a simple way to express this angle in terms of the differences in the phase and angle components of the quaternions. The conversation also mentions the use of inner product and provides links to resources for further understanding and potential solutions. However, it is concluded that there may not be a simple answer to this problem.
  • #1
Fidelis
2
0
Hello!

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?
 
Last edited by a moderator:
Mathematics news on Phys.org
  • #2
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
Which says use the dot product.
 
Last edited by a moderator:
  • #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!

Thanks
 
  • #4
  • #5
I assume by Angle-Phase-Form you mean the polar decomposition as in here:
https://en.wikipedia.org/w/index.ph...5732179#Exponential.2C_logarithm.2C_and_power

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
http://www.geometrictools.com/Documentation/Quaternions.pdf
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:
https://sourceforge.net/p/qspline-cc0/code/1/tree/qspline/trunk/qspline.c#l378
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:

Related to Finding the Angle Between Two Quaternions: A Simple Solution?

1. What is the meaning of the "angle between two quaternions"?

The angle between two quaternions is a measure of the difference in orientation between the two objects represented by the quaternions. It is a metric used in 3D graphics and animation to determine the amount of rotation needed to align one quaternion with the other.

2. How is the angle between two quaternions calculated?

The angle between two quaternions can be calculated using a formula known as the "arc-cosine" or "dot product" formula. This involves taking the dot product of the two quaternions and then applying an inverse cosine function to the result. The resulting angle is measured in radians.

3. Can the angle between two quaternions be negative?

Yes, the angle between two quaternions can be negative. This occurs when the two objects represented by the quaternions are rotated in opposite directions, resulting in a difference in orientation greater than 180 degrees. In this case, the angle between the quaternions is measured as a negative value.

4. What is the range of possible values for the angle between two quaternions?

The angle between two quaternions can range from 0 to 180 degrees, or from 0 to pi radians. This is because quaternions can represent rotations of up to 180 degrees in any direction in 3D space. It is important to note that this range is only for the absolute value of the angle, and as mentioned before, the angle itself can be negative.

5. How is the angle between two quaternions used in practical applications?

The angle between two quaternions is commonly used in computer graphics and animation to interpolate between two rotations. It is also used in robotics and motion planning to calculate the shortest path between two orientations. Additionally, it can be used in physics simulations and virtual reality applications to accurately represent the orientation of objects in 3D space.

Similar threads

Replies
1
Views
758
Replies
3
Views
2K
Replies
9
Views
1K
  • General Math
Replies
20
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
944
Replies
4
Views
1K
  • Advanced Physics Homework Help
Replies
0
Views
693
Replies
7
Views
2K
  • General Math
Replies
1
Views
1K
Back
Top