Rotating object using product of two quaternions

Nahrawess
Messages
1
Reaction score
1
Homework Statement
develop an aplpication on Qt6 that rotates objects using quaternion.
Relevant Equations
product of two quaternion:
q=q1*q2
Hello guys, I'm a newbie.

So I have developped an application that rotates a cube using quaternion.

The initial values of the quaternion are ( w=1.0, x=0.0, y=0.0, z=0.0).

Now I want to apply two consecutive rotation using two different quaternion values:
The first rotation corresponds to this quaternion q1= (w=-0.169757, x=-0.00949828, y=-0.550083, z=0.817619).
The second rotation is applied right after the one above and the quaternion (q2) values are (w=0.542742, x=-0.0784193, y=0.663872, z=-0.508483).

So I get a new orientation of the cube; let's call it orientation_1 which is the result of applying two consecutive rotations.

Now, I want to apply the second rotation (second quaternion) directly to the initial cube's orientation where (w=1.0, x=0.0, y=0.0, z=0.0) and get the same orientation as the orientation obtained after applying two consecutive rotations which I called orientation_1. So I thought about getting the product of the two quaternion q1*q2 and use it to rotate the object however I don't get the same orientation as the one that I got when I applied two consecutive rotation.

I really don't get why I don't get the same orientation.
Can someone please help me.
Thank you All.
 
Last edited:
Physics news on Phys.org
Just a guess but order of rotation steps is important so that means your product order must be important too. If your steps are apply A then B to rotate the object then your product must be B*A as in B(A x) = (B*A) x

On page 7 of this pdf, it talks about the product of unit quaternions and rotations:

https://graphics.stanford.edu/courses/cs348a-17-winter/Papers/quaternion.pdf
 
Last edited:
Hi, I had an exam and I completely messed up a problem. Especially one part which was necessary for the rest of the problem. Basically, I have a wormhole metric: $$(ds)^2 = -(dt)^2 + (dr)^2 + (r^2 + b^2)( (d\theta)^2 + sin^2 \theta (d\phi)^2 )$$ Where ##b=1## with an orbit only in the equatorial plane. We also know from the question that the orbit must satisfy this relationship: $$\varepsilon = \frac{1}{2} (\frac{dr}{d\tau})^2 + V_{eff}(r)$$ Ultimately, I was tasked to find the initial...
The value of H equals ## 10^{3}## in natural units, According to : https://en.wikipedia.org/wiki/Natural_units, ## t \sim 10^{-21} sec = 10^{21} Hz ##, and since ## \text{GeV} \sim 10^{24} \text{Hz } ##, ## GeV \sim 10^{24} \times 10^{-21} = 10^3 ## in natural units. So is this conversion correct? Also in the above formula, can I convert H to that natural units , since it’s a constant, while keeping k in Hz ?
Back
Top