1
$\begingroup$

I am considering taking a given rotation quaternion $Q$, about a given point $P1$, and obtaining a vector3 $V$.

my thought pattern is thus: given a point $P1$, and a quaternion $Q$

obtain another point $P2$ in the direction of $Q$ an arbitrary distance X away (could equal 1),

then subtract those 2 points to arrive at a unique vector3 $V$

Is this sound logic, or have I made a mistake somewhere, and how would I arrive at $P2$ as I am a little lost on this?

EDIT: clarified problem

  • 0
    @StevenStadnicki yes a vector is 'baseless', but at the same time not. A vector is by definition a magnitude, and a direction, but what makes them baseless is that they can be placed anywhere, and still have the same meaning. the same way that a quaternion is baseless as it is only an orientation that can be applied to any thing. my goal was to be able to use a quaternion to obtain a `vector3` such that something like a forward, or look `vector` could be found, but thanks to some reasoning work a Vector3 can be treated as a quaternion which simplifies the problem to a quaternion identity.2012-06-06

1 Answers 1

1

This question actually has flawed logic: even if $P1$ is given in order to arrive at $P2$ in 3space would require a vector3, so by nature you would need the very vector being solved for to even approach the problem.

Though it is still possible to work through the problem there is just more then one solution to the problem as follows.

Given a quaternion representing a rotation in 3space an axis-vector may be chosen to be manipulated by the quaternion to arrive at a vector in the direction of the quaternion, and the axis-vector chosen determines the solution found. technically there are 6 solutions for any given quaternion if not Vector to be rotated is given.

By virtue of quaternion multiplication $v' = q * v * q^*$ ($q^*$ referring to the conjugate of $q$) keeping in mind that this equation only holds if $v$ is not the zero-vector $<0,0,0>$, and $q$ is not the multiplicative identity $<1,0,0,0>$, and has been normalized.

treating the components of the vector $v$ as the imaginary vector ($ijk$) of a second quaternion, and the real portion of that quaternion as $0$. therefore $\rightarrow<0,x,y,z>$, and quaternion multiplication can take place.

solution

$v'=q*v*c$ ($c$ referring to conjugate)

$= *<0,Vx,Vy,Vz>*=<0,V'x,V'y,V'z>$ shorthand without having to do all multiplication step by step:

v'x = 2*(Qw*Vz*Qj + Qi*Vz*Qk - Qw*Vy*Qk + Qi*Vy*Qj) + Vx*(Qw^2 + Qi^2 - Qj^2 - Qk^2); v'y = 2*(Qw*Vx*Qk + Qi*Vx*Qj - Qw*Vz*Qi + Qj*Vz*Qk) + Vy*(Qw^2 - Qi^2 + Qj^2 - Qk^2); v'z = 2*(Qw*Vy*Qi - Qw*Vx*Qj + Qi*Vx*Qk + Qj*Vy*Qk) + Vz*(Qw^2 - Qi^2 - Qj^2 + Qk^2); 

text file containing diriviation can be obtained upon email request