Rotate the segment by quaternion - how to find actual segment's end position?

382 Views Asked by At

I have an segment from [0,0,0] to [0,1,0] (left-handed coordinate system, with Y axis up) which is non-rotated. The rotation is described as quaternion ([w,x,y,z] = [1,0,0,0] for non-rotated).

Then, I rotate my segment via some normalized quaternion Q = [w1,x1,y1,z1] by the pivot of [0,0,0]. How to calculate the position of the segment's end now?

If I changed the pivot to [0,0.5,0], how would that change the formula?

edit: because of comment, I clarify what I meant by "pivot" and how the position of the start/end of the segment changes because of rotation (for 2d scenario, but 3d is analogical): enter image description here

1

There are 1 best solutions below

2
On BEST ANSWER

Quaternions (working by conjugation alone) can only represent rotations whose axes pass through the origin. (The origin is always fixed since $q0q^{-1}=0$.)

You can translate rotations off the origin by using the addition operation of quaternions.

The first step would be to translate the "pivot" to the origin, then you would apply the rotation, and then you would translate it back from whence it came.

$x\mapsto q(x-0.5j)q^{-1}+0.5j$

So if $T$ represents the translation of the origin to $0.5j$, then the original rotation $R$ changes to $TRT^{-1}$ to accommodate the shift.