quat-calc.hpp File Reference

Go to the source code of this file.


double abs (const quat &q)
double norm (const quat &q)
quat normal (const quat &q)
quat inv (const quat &q)

Function Documentation

double abs const quat q  )  [inline]

return abs

Definition at line 18 of file quat-calc.hpp.

Referenced by normal().

00019 {
00020   return std::sqrt(q.x*q.x +q.y*q.y +q.z*q.z +q.r*q.r);
00021 }

double norm const quat q  )  [inline]

return norm

Definition at line 25 of file quat-calc.hpp.

Referenced by inv().

00026 {
00027   return q.x*q.x +q.y*q.y +q.z*q.z +q.r*q.r;
00028 }

quat normal const quat q  )  [inline]

return the normalized quat

Definition at line 32 of file quat-calc.hpp.

References abs().

Referenced by vt2q().

00033 {
00034   double abs_q(abs(q));
00035   return quat( q.x/abs_q, q.y/abs_q, q.z/abs_q, q.r/abs_q );
00036 }

quat inv const quat q  )  [inline]

return the inverse quat

Definition at line 44 of file quat-calc.hpp.

References conj(), and norm().

00045 {
00046   return conj(q)/norm(q);
00047 }

Generated on Tue Mar 15 16:02:38 2005 for QVM by  doxygen 1.4.1