Go to the source code of this file.
Functions | |
vec | im (const quat &q) |
vec | q2vt (const quat &q) |
quat | conj (const quat &q) |
void | swap (quat &q1, quat &q2) |
|
return the imaginary part Definition at line 3 of file quat-misc.hpp. Referenced by orbit(), and rotate().
|
|
return vec from quat (|vec|=theta) Definition at line 10 of file quat-misc.hpp. 00011 { 00012 double sin_theta_half; 00013 double theta( 2.*std::acos(q.r) ); 00014 00015 if(theta<M_PI){ 00016 sin_theta_half =std::sin(0.5*theta); 00017 } 00018 else{ 00019 theta -=2.*M_PI; 00020 sin_theta_half =-std::sin(0.5*theta); 00021 } 00022 00023 return vec( theta*q.x/sin_theta_half, 00024 theta*q.y/sin_theta_half, 00025 theta*q.z/sin_theta_half ); 00026 }
|
|
return the conjugate quat Definition at line 34 of file quat-misc.hpp. Referenced by inv(), orbit(), and rotate().
|
|
swap two quats Definition at line 45 of file quat-misc.hpp. 00046 { 00047 quat _q1(q1); 00048 q1 = q2; 00049 q2 =_q1; 00050 }
|