I programmed https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula for some graphics stuff, but encountered what seems to be a math problem with the formula, as discussed below...

The wikipedia formula itself is,
    $\vec v_{rot} = \vec v\cos\theta\ +\ (\vec k\times\vec v)\sin\theta \ + \ \vec k(\vec k\cdot\vec v)(1-\cos\theta)$
where $\vec v$ is the original vector to be rotated through an angle $\theta$ around a unit vector $\vec k$ (that passes through the origin). And, by the way, I programmed $\vec v\times\vec k$, rather than vice versa, for the "direction convention".

For my troublesome example, I had $\theta=90^o$ so the first term vanishes, and I had $\vec v\perp\vec k$ so the third term vanishes, leaving just
    $\vec v_{rot}=\vec v\times\vec k$.

In particular, picture usual axes $y$ to your right, $z$ up, and $x$ out-of-the-screen.
Rotation axis $\vec k$'s a unit from the origin $(x,y,z)=(0,0,0)$ along the $y$-axis to point $(0,1,0)$. And the vector $\vec v$ to be rotated starts in the $yz$-plane at point $(0,1,1)$ and goes parallel to the $x$-axis, ending at point $(1,1,1)$.

So the expected result would rotate $\vec v$ by $90^o$ around the $y$-axis (clockwise looking from the origin along $y$), giving $\vec v_{rot}$ starting in the $xy$-plane at point $(1,1,0)$ and heading down to $(1,1,-1)$. But the cross-product loses that $(1,1,-)$, and goes from $(0,0,0)$ to $(0,0,-1)$ instead.

The numerical problem is that the tail of $\vec k$ and the tail of $\vec v$ don't coincide. I could do any kind of translations back-and-forth, before and after the rotation. But I'm not seeing any translation that takes the original tail of $\vec v$ at $(0,1,1)$ and ultimately translates back to $\vec v_{rot}$'s tail at $(1,1,0)$. The cross-product seems to irretrievably lose that information in this kind of situation (where $\vec v$ and $\vec k$'s tails don't coincide).

So is there any way to get that expected result above, in the example case and, of course, in the general case? Or am I just making some blunder, since I'm not googling any other discussion of this problem, which I imagine would be pretty common?

    E d i t
Let me try to clarify/simplify the question in response to @LordSharktheUnknown's comments below.

Firstly, in the case where $\theta=90^o$ and $\vec v\perp\vec k$, Rodrigues' formula simplifies to $\vec v_{rot}=\vec v\times\vec k$. Is that right?

If so, then the usual definition of cross-product, e.g., http://tutorial.math.lamar.edu/Classes/CalcII/CrossProduct.aspx defines only the vector's head, always leaving its tail implicitly at the origin.

Therefore, the tail of every $\vec v_{rot}=\vec v\times\vec k$ is necessarily at the origin. But that's typically not going to be the expected result of rotating a vector whose tail doesn't start at the origin, as illustrated by my example. So how do you use Rodrigues' formula in such cases (and what's the "fix" for the general case)?

  • 1
    $\begingroup$ That's not the formula as given in your wikipedia link. Also, $v\mapsto v\times k$ is certainly not a rotation. $\endgroup$ – Lord Shark the Unknown Dec 27 '18 at 8:18
  • $\begingroup$ @LordSharktheUnknown Thanks, Shark. Just a typo (now fixed) in the post. Programmed correctly, and that term still vanishes (by $\vec v\perp\vec k$), so the point of the discussion isn't affected. $\endgroup$ – John Forkosh Dec 27 '18 at 8:23
  • $\begingroup$ Why don't you put $v=(0,1,1)$ and $v=(1,1,1)$ into your formula? $\endgroup$ – Lord Shark the Unknown Dec 27 '18 at 8:25
  • $\begingroup$ @LordSharktheUnknown I'm not following your implied suggestion that something different happens than what I said. For example, tutorial.math.lamar.edu/Classes/CalcII/CrossProduct.aspx shows the usual cross-product definition which just defines the head of the vector, always leaving the tail implicitly at the origin. $\endgroup$ – John Forkosh Dec 27 '18 at 8:39
  • 1
    $\begingroup$ In this context, your “vector” is in fact two points that need to be rotated simultneously. Vectors as used in Rodrigues’ formula don’t have “tails.” If you want to rotate this directed line segment about its origin point instead of the coordinate origin, then you’ll have to throw in a couple of translations. $\endgroup$ – amd Dec 28 '18 at 4:46

The vector being rotated in the Wikipedia article that you reference is the position vector of a point—its “tail” is at the origin and remains fixed. Described in those terms, what you’re trying to do is rotate a directed line segment about its initial point, which isn’t necessarily at the origin. To perform this transformation, translate the origin to the initial point (tail), apply Rodrigues’ formula to the translated end point (head), then translate back.

  • $\begingroup$ Thanks, again. Oh, and look at that -- by checking your answer, I got back the two points I lost when LordSharktheUnknown downvoted the question :) $\endgroup$ – John Forkosh Dec 28 '18 at 8:47

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.