Convert a Unit Vector to a Quaternion

Posted by Hmm on Stack Overflow See other posts from Stack Overflow or by Hmm
Published on 2011-01-08T21:51:25Z Indexed on 2011/01/08 21:53 UTC
Read the original article Hit count: 325

Filed under:
|
|
|

So I'm very new to quaternions, but I understand the basics of how to manipulate stuff with them. What I'm currently trying to do is compare a known quaternion to two absolute points in space. I'm hoping what I can do is simply convert the points into a second quaternion, giving me an easy way to compare the two.

What I've done so far is to turn the two points into a unit vector. From there I was hoping I could directly plug in the i j k into the imaginary portion of the quaternion with a scalar of zero. From there I could multiply one quaternion by the other's conjugate, resulting in a third quaternion. This third quaternion could be converted into an axis angle, giving me the degree by which the original two quaternions differ by.

Is this thought process correct? So it should just be [ 0 i j k ]. I may need to normalize the quaternion afterwards, but I'm not sure about that.

I have a bad feeling that it's not a direct mapping from a vector to a quaternion. I tried looking at converting the unit vector to an axis angle, but I'm not sure this would work, since I don't know what angle to give as an input.

© Stack Overflow or respective owner

Related posts about vector

Related posts about axis