Advertisement

Dot (Inner) product of 2 quaternions

Started by February 18, 2003 03:48 AM
6 comments, last by mannam 22 years ago
Can anyone tell me the meaning of dot product between 2 quaternions? What''s the implication of positive and negative product? Thanks. Man
inline float innerproduct( const quaternion& q1, const quaternion& q2)
{
return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w;
}
Advertisement
And it mean the "angle" between quaternions, So i think it is angle of the most of shortest ways between some point in q1 and the same in a q2.


Thanks! minorlogic

That means it''s the same as 3D vector?
Almost ! if we take two heading vectors and angle between it will be same as a between qurternions BUT only if thay don''t rotate around heading.

Just imagime sphere , and point on this. We rotate sphere from q1 to q2 (by shortest way ), and if you will find the point on sphere that does the longest path , it is a angle between quaternions.
ok thanks!
Advertisement
Am I wrong in thinking it will be the same thing as the dot between two vectors? Where the dot product gives you -1.0 to 1.0


1.0 means they are pointing directly the same way, -1directly opposite and a value of 0 90 degrees off? You can then use acos to find the angle?

Correct me if im wrong.
RatLord:
Yes you are wrong. Imagine that q1 and q2 rotate around the same line (vector) . But first for a 30 degrees and second 60. The angle bettwen tham will be 30 degrees.


It is true that it give the value from 0 to 1, but it is not same that angle between vectors.

This topic is closed to new replies.

Advertisement