This seems like it should be a simple problem, but I've been stuck on it for about a day now. It's technically a programming problem, but I'm posting it here because the root of the problem is really mathematics.

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?


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.

  • $\begingroup$ Apply a velocity? What does that mean? Is this a physical problem with some applied force (acceleration)? Or, can you write an equation for the object's velocity vector (either with respect to its local frame or the global frame) as a function of time? $\endgroup$ – Muphrid Jan 3 '15 at 4:43
  • $\begingroup$ I can write it with respect to time. As I said in the question, but didn't really elaborate on, is that the object is part of a computer program I'm working on. Every frame has a time and the object doesn't have any acceleration, just constant velocity. Every time the frame updates, the object gets moved that much further. The problem is that the velocity vector sees the object's rotation as its local reference, but I need to know what that vector looks like in reference to the global frame. $\endgroup$ – Nathaniel D. Hoffman Jan 3 '15 at 5:21
  • $\begingroup$ Constant velocity in the object's intrinsic frame? Or constant velocity with respect to the global frame? $\endgroup$ – Muphrid Jan 3 '15 at 5:23
  • $\begingroup$ The constant velocity is in respect to the object's intrinsic frame. I'm trying to find the equivalent velocity in respect to the global frame. $\endgroup$ – Nathaniel D. Hoffman Jan 3 '15 at 5:35

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.
  • $\begingroup$ Thank you, I think that's what I needed. $\endgroup$ – Nathaniel D. Hoffman Jan 3 '15 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.