What is the derivative of a quaternion with a changing unit vector?

In summary, we discussed the unit rotation quaternion q(t) and its derivative, in which we discovered that if the unit vector û(t) is constant, then the derivative can be expressed as q-dot(t) = (1/2) * q-omega(t) * q(t). However, if û(t) is not constant, we would need to use the chain rule and include the derivative of û(t). We also explored the equation for p(t), which describes the motion of a rigid-body, and found that it can be simplified by placing one of the quaternion bases (such as k) at the centre of the circle traced out by û(t). We also discussed the use of the variable τ = t/T in
  • #1
nburo
33
0
Hello everyone.

Here's a unit rotation quaternion :

[tex]q(t) = [cos\frac{\theta(t)}{2} , \hat{u}(t)\cdot sin\frac{\theta(t)}{2}][/tex]

We know that if [tex]\hat{u}(t)[/tex] is constant, then our quaternion's derivative should be :

[tex]\dot{q}(t) = \frac{1}{2}\cdot q_\omega(t)\cdot q(t)[/tex]

But what if [tex]\hat{u}(t)[/tex] wasn't constant? What would it look like? Same thing?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
nburo said:
But what if [tex]\hat{u}(t)[/tex] wasn't constant? What would it look like? Same thing?

Hello nburo! :smile:

(have a û for copy-and-pasting :wink:)

No, you'd have to apply the chain rule, including the derivative of û(t).

(And of course û is a unit vector, so û.û = 1, so û.û' = 0, ie û' is always perpendicular to û. :smile:)
 
  • #3
Hello tiny-tim! =)

I prefer LaTeX =P

First of all, thanks for answering.

So would it look like this?

[tex]\dot{q}(t) = [-sin\frac{\theta(t)}{2} \cdot \frac{\dot{\theta}(t)}{2} , \dot{\hat{u}}(t)\cdot sin\frac{\theta(t)}{2} + \hat{u}(t)\cdot cos\frac{\theta(t)}{2}\cdot \frac{\dot{\theta}(t)}{2}][/tex]

So

[tex]\dot{q}(t) = [-\frac{1}{2}\cdot \omega(t)\cdot sin\frac{\theta(t)}{2} , \dot{\hat{u}}(t)\cdot sin\frac{\theta(t)}{2} + \frac{1}{2}\cdot \hat{u}(t)\cdot \omega(t) \cdot cos\frac{\theta(t)}{2}][/tex]

And [tex]\dot{\theta} = \omega[/tex] only if [tex]\theta[/tex] isn't constant.

So, if I'm not wrong, I am a bit confused. Since [tex]\omega[/tex] should be a vector, but it also appears into the scalar part, which doesn't work. I must be wrong... I mean, even if we say [tex]\hat{u}(t)[/tex] is constant, I don't even end up with the result I expected. And even if we modify the original quaternion to be

[tex]
q(t) = [cos\frac{\Vert\theta(t)\Vert}{2} , \hat{u}(t)\cdot sin\frac{\Vert\theta(t)\Vert}{2}]
[/tex]

it doesn't seem to work either. Help =(
 
  • #4
nburo said:
So, if I'm not wrong, I am a bit confused. Since [tex]\omega[/tex] should be a vector, but it also appears into the scalar part, which doesn't work. I must be wrong... I mean, even if we say [tex]\hat{u}(t)[/tex] is constant, I don't even end up with the result I expected.

Hello nburo! :smile:

Why should ω be a vector? :confused:

I don't see anything wrong with that equation for q-dot.

Does this come from a problem about a specific quaternion rotation?​
 
  • #5
tiny-tim said:
Hello nburo! :smile:

Why should ω be a vector? :confused:

Well, when we have [tex]\hat{u}(t)[/tex] constant :

[tex]
\dot{q}(t) = \frac{1}{2}\cdot q_\omega(t)\cdot q(t)
[/tex]

Here [tex]q_\omega(t) = [0, \omega(t)][/tex], that mean [tex]\omega(t)[/tex] should be a 3d-vector

tiny-tim said:
I don't see anything wrong with that equation for q-dot.

Does this come from a problem about a specific quaternion rotation?​

Well, yes, but I don't think it should change anything. This quaternion [tex]q(t)[/tex] describes the motion of a rigid-body. Our [tex]\theta[/tex] should be the angle around [tex]\hat{u}(t)[/tex] which is [tex]u(t)[/tex] normalized. We also have an equation for [tex]u(t)[/tex], it's the equation of spherical interpolation given by :

[tex]p(t) = [0, u(t)] = \frac{sin(1-\frac{t}{T})\phi}{sin\phi}\cdot A + \frac{sin\frac{t}{T}\phi}{sin\phi}\cdot B[/tex]

where t is time, T is the final time, [tex]\phi[/tex] is the angle between A and B. Finally, A and B are position quaternions on a unit sphere.

But I don't think this is relevant to find q-dot :P
 
Last edited:
  • #6
nburo said:
Here [tex]q_\omega(t) = [0, \omega(t)][/tex], that mean [tex]\omega(t)[/tex] should be a 3d-vector

No, qω (t) = [0. ω(t)û] …

ω is a scalar, and only û is a vector.
[tex]p(t) = [0, u(t)] = \frac{sin(1-\frac{t}{T})\phi}{sin\phi}\cdot A + \frac{sin\frac{t}{T}\phi}{\phi}\cdot B[/tex]

where t is time, T is the final time, [tex]\phi[/tex] is the angle between A and B. Finally, A and B are position quaternions on a unit sphere.

ok, I think that means that û(t) traces out an arc of a circle between the positions of A and B. Putting one of the quaternion bases (k, say) at the centre of this circle would probably simplify things.
 
  • #7
You are very fast =) Thks again for helping

tiny-tim said:
No, qω (t) = [0. ω(t)û] …

ω is a scalar, and only û is a vector.

Oooh, that could make sense =) But would the û you put there be the same than the original one? Let's try :

[tex]\frac{1}{2}\cdot q_\omega(t)\cdot q(t) = \frac{1}{2}\cdot [0, \omega(t) \hat{u}]\cdot [cos\frac{\theta(t)}{2} , \hat{u}\cdot sin\frac{\theta(t)}{2}] = [0 - \omega(t)\cdot sin\frac{\theta(t)}{2} \cdot \hat{u}^2 , 0 + \hat{u}\cdot \omega(t) \cdot cos\frac{\theta(t)}{2} + \omega(t) \cdot sin\frac{\theta(t)}{2} \cdot (\hat{u}\times\hat{u}) ][/tex]

[tex] = \frac{1}{2}[- \omega(t)\cdot sin\frac{\theta(t)}{2} , \hat{u}\cdot \omega(t) \cdot cos\frac{\theta(t)}{2}] = \dot{q}(t)[/tex]

Since the cross product of 2 identical vectors is 0. It works, thks! :wink:

tiny-tim said:
ok, I think that means that û(t) traces out an arc of a circle between the positions of A and B. Putting one of the quaternion bases (k, say) at the centre of this circle would probably simplify things.

How so?
:bugeye:

EDIT : Be right back in 2 hours : take your time my friend =)
 
  • #8
nburo said:
How so?
:bugeye:

erm :redface:your job, not mine!

Try it and see! (I admit I haven't, but I think it'll work) :smile:
 
  • #9
I made a mistake earlier in my p(t) equation, I corrected. Now I'm trying the equation. I'll repost what I found later =)
 
  • #10
nburo said:
I made a mistake earlier in my p(t) equation, I corrected.

Yes, I assumed that! :rolleyes: :biggrin:

btw, I forgot to ask … what's φ? … it seems to have come from nowhere. :confused:
 
  • #11
tiny-tim said:
btw, I forgot to ask … what's φ? … it seems to have come from nowhere. :confused:

=0

it's the angle between A and B! =)
 
  • #12
ah, that makes more sense!

So if ê is the unit vector at the centre of the circle joining A and B,

then B = [cosφ/2, êsinφ/2]A :wink:
 
  • #13
tiny-tim said:
ah, that makes more sense!

So if ê is the unit vector at the centre of the circle joining A and B,

then B = [cosφ/2, êsinφ/2]A :wink:

:eek:

=)

But that's only if we take the k base. We really don't know if our axis of rotation û will move this way around ê. Or maybe it doesn't change anything? Argh, I'm so confused :confused:

Anyways, I also derived p(t) :

[tex]\dot{p}(t) = \frac{\phi\cdot cos(\frac{t}{T}\phi)}{T\cdot sin\phi}B - \frac{\phi\cdot cos(\phi - \frac{t}{T}\phi)}{T\cdot sin\phi}A[/tex]

Because A and B are constant vectors.

Also, in interpolation references, they use something like [tex]\tau = \frac{t}{T}[/tex] so Tau is between 0 and 1. But is it a good thing to substitute like I did to get p(t) in function of time?
 
  • #14
nburo said:
But that's only if we take the k base. We really don't know if our axis of rotation û will move this way around ê. Or maybe it doesn't change anything? Argh, I'm so confused :confused:

What's the k base? :confused:

You said that these quaternions represent rotations of a rigid body …

that simply means that one of the bases (the first one) is the identity rotation

(and the other three can be any three perpendicular unit vectors).

All rotations are of that form.
 
  • #15
tiny-tim said:
What's the k base? :confused:

You said that these quaternions represent rotations of a rigid body …

that simply means that one of the bases (the first one) is the identity rotation

(and the other three can be any three perpendicular unit vectors).

All rotations are of that form.

Haha =) I get it, sorry =P

Also, with B = [cosφ/2, êsinφ/2]A, does that mean I can simply substitute B by that in my main interpolation equation?


What about my time substitution in interpolation? Is it alright?

:cool:
 
  • #16
nburo said:
Also, with B = [cosφ/2, êsinφ/2]A, does that mean I can simply substitute B by that in my main interpolation equation?

Yup! :biggrin:
What about my time substitution in interpolation? Is it alright?

Looks ok to me. :smile:
 
  • #17
tiny-tim said:
Yup! :biggrin:


Looks ok to me. :smile:

You're one quaternion beast! :wink:

Before using our new equation, my research boss told me to do something.

David Baraff published some article in Siggraph '97. He developped a proof that even when û(t) is not constant, a quaternion time derivative can be expressed this way :

[tex]
\dot{q}(t) = \frac{1}{2}\cdot q_\omega(t)\cdot q(t)
[/tex]

Remember? It's the time derivative for û as a constant! Well it seems to work when û(t) isn't constant too! Weird heh?

So I have to find an equation for [tex]q_\omega(t)[/tex] using this identity :

[tex]
q_\omega(t) = 2 \cdot \dot{q}(t) \cdot q^*(t)
[/tex]

using a q(t) that has a u(t) that is described by an interpolation equation. My boss told me to start with a constant theta to see what would happen. I'm going to work on that. I will post my result if I get something interesting.

Thanks for all my friend!
 
  • #18
David Baraff

nburo said:
David Baraff published some article in Siggraph '97. He developped a proof that even when û(t) is not constant, a quaternion time derivative can be expressed this way :

[tex]
\dot{q}(t) = \frac{1}{2}\cdot q_\omega(t)\cdot q(t)
[/tex]

Remember? It's the time derivative for û as a constant! Well it seems to work when û(t) isn't constant too! Weird heh?

ah! you mean (4-2) and Appendix B in http://www-2.cs.cmu.edu/~baraff/sigcourse/notesd1.pdf and http://www-2.cs.cmu.edu/~baraff/sigcourse/notesd2.pdf :smile:

(btw, I forgot to mention … LaTeX will give you extra high brackets "to fit" if you type \left[ and \right] (you must use both) … also works for () {} and || :wink:)
 
Last edited by a moderator:
  • #19
Last edited by a moderator:
  • #20
There is a lot of sloppiness of notation in this thread -- and in Baraff's lecture notes. There are four ways to write the time derivative of a unit quaternion, all variations on the theme

[tex]\dot{Q} = \frac 1 2 \begin{bmatrix} 0 \\ {\boldsymbol{\omega}} \end{bmatrix} Q[/tex]

In various texts, you might see the right-hand side negated and you might see the order in which the two quaternion factors appear on the right-hand side switched. For example, I use

[tex]\dot{Q}_{A\to B} =
-\,\frac 1 2
\begin{bmatrix} 0 \\ {\boldsymbol{\omega}_{A\to B:B}} \end{bmatrix}
Q_{A\to B}[/tex]

The reason for these variations include
  • Whether the quaternion represents a rotation or a transformation.
    I long ago learned to distinguish these concepts.
    - Rotation: The physical rotation of some object.
    - Transformation: Converting vectors from one reference frame to another.
    Quaternions (and matrices, and any other chart on SO(3)), can be used to represent both concepts.

  • The sense of the quaternion (e.g., inertial to body versus body to inertial).
    The transformation matrix from frame B to A is the transpose of the transformation matrix from frame A to B. The same goes for quaternions, with conjugates instead of transposes.

  • Left versus right quaternions.
    Here are two ways to use a quaternion Q to rotate or transform a vector x:

    [tex]\begin{aligned}
    \begin{bmatrix} 0 \\ \boldsymbol{x}_L \end{bmatrix} &=
    Q \begin{bmatrix} 0 \\ \boldsymbol{x} \end{bmatrix} Q^{\ast} \\
    \begin{bmatrix}0 \\ \boldsymbol{x}_R \end{bmatrix} &=
    Q^{\ast} \begin{bmatrix} 0 \\ \boldsymbol{x} \end{bmatrix} Q
    \end{aligned}[/tex]

    The only difference between the two equations is whether the quaternion Q appears in unconjugated form to the left or to the right of the pure imaginary quaternion formed from the vector to be rotated / transformed.

  • The frame in which the angular velocity is represented.
    Most, but not all, people represent the angular velocity vector in the body frame.

With all the variations listed above, by not being careful about notation you might find yourself in a vehement argument with someone when in reality the two of you are in vehement agreement. I have intervened in such arguments more than once.
 
Last edited:
  • #21
Thank you D H. In my problem, I need to rotate, not to transform, i.e. every equation must be in a global/fixed frame. Which notation should I use?
 
  • #22
There is no right or wrong way. What is important is to recognize that multiple representation schemes exist. What you need to do is to be explicit about what you mean by the quaternion (left or right, rotation or transformation, direction sense) and be explicit in which frame you represent the angular velocity.

Aside: You can hardly describe rotation without ascribing a reference frame to the body being rotated. Rotation and transformation are flip sides of the same coin.
 

1. What is a quaternion?

A quaternion is a mathematical structure that extends the complex numbers to four dimensions. It is often used in 3D rotations and orientation calculations in computer graphics and robotics.

2. What is the unit vector in a quaternion?

The unit vector in a quaternion represents the direction of rotation and is typically denoted as i, j, or k. It is defined as a vector of length 1 that is perpendicular to the imaginary components of the quaternion.

3. What is the derivative of a quaternion?

The derivative of a quaternion is the rate of change of the quaternion with respect to time. It is a vector that describes the axis and magnitude of rotation at a specific point in time.

4. How does the unit vector affect the derivative of a quaternion?

The unit vector in a quaternion affects the derivative by determining the axis of rotation. As the unit vector changes, the axis of rotation will also change, resulting in a different derivative.

5. What is the significance of the derivative of a quaternion with a changing unit vector?

The derivative of a quaternion with a changing unit vector is significant because it describes the instantaneous rate of change in the quaternion's orientation. This information is crucial in many applications, such as 3D animation and robotic control systems.

Similar threads

Replies
1
Views
824
Replies
6
Views
2K
Replies
5
Views
975
  • Introductory Physics Homework Help
Replies
10
Views
111
Replies
4
Views
188
Replies
3
Views
1K
Replies
13
Views
1K
Replies
3
Views
1K
Replies
2
Views
178
Back
Top