PDA

View Full Version : Norm of a Quaternion?



Rockfort
05-18-2001, 12:49 PM
Please help me! In two books (Game Programming Gems, and 3D Game Engine Design), they say that the norm of a quaternion is :

N(q) = w^2 + x^2 + y^2 + z^2;

But on the net (on many web sites devoted to game programming), they say that the norm is:

N(q) = sqrt(w^2 + x^2 + y^2 + z^2);

So what is the norm of a quaternion?!?
thx!

Sheepie
05-18-2001, 02:34 PM
Here's some code to Normalize a Quaternion-

mag=sqrt(quat.w^2+quat.x^2+quat.y^2+quat.z^2)
quat.w=quat.w/mag
quat.x=quat.x/mag
quat.y=quat.y/mag
quat.z=quat.z/mag

ChrisT
05-19-2001, 02:50 AM
Hi,

Quaternion is fourth deimension vector. So it's a vector like another and it's Euleur norm is sqrt(x^2+y^2+z^2+w^w^2). The formule to normalize the vector was given you by Sheepie.
When you use a quaternion for rotation, its norm must be the unit norm.

bye.

ChrisT
05-19-2001, 02:52 AM
Hi,

Some mistakes: you must read
sqrt(x^2+y^2+z^2+w^2).

Sorry about that.

YankeesFan
05-21-2001, 10:17 AM
N(q) = w^2 + x^2 + y^2 + z^2; is the
NORM of q.

N(q) = sqrt(w^2 + x^2 + y^2 + z^2); is the MODULUS of q.

Sheepie
05-21-2001, 11:28 AM
Here's some code to Normalize a Quaternion-
mag=sqrt(quat.w^2+quat.x^2+quat.y^2+quat.z^2)
quat.w=quat.w/mag
quat.x=quat.x/mag
quat.y=quat.y/mag
quat.z=quat.z/mag