Velocity vector transformations with respect to a global frame of reference

1.5k Views Asked by At

I have an object moving in a 3D space. This space has three coordinate axes and these are global axes, and space is the global reference frame. The object also has three coordinate axes and these can be in any orientation in respect to the global frame as the object is rotated.

Q: If I apply a velocity vector in respect to the local frame, how can I find the equivalent vector in the global frame?

Given:

A quaternion describing the rotation of the object in 3D space.

A vector position for the object in space.

A vector velocity that I want to add to the position over time.

I have a feeling the answer is really simple and I'm just thinking of it the wrong way. Thanks for your help.

1

There are 1 best solutions below

1
On BEST ANSWER

Your problem can be reduced to a few easy steps:

  • Find an expression for $v$ as a linear combination of your body basis vectors, $b_1, b_2, b_3$.
  • Determine the linear map $R$ that relates the global basis vectors ($g_1, g_2, g_3$) to the body basis. For instance, let $R(g_1) = b_1$, and so on. This should be determined by your quaternion.

Your quaternion is almost certainly written in terms of the global basis, so you can proceed as follows:

  • Let $w = R^{-1}(v)$ and write $w$ in the global basis. $w$'s components in the global basis are the same as $v$'s components in the body basis, so you don't actually do any matrix inversion here. (Note: I include this step to be pedantic; a programmer would probably not even make note that this is done, or that there is even a distinction between $v$ and $w$. You could do this step without actually writing any code.)
  • Compute $v = R(w)$, with $R$ described in the global basis. This gives you $v$ in the global basis.