7 #ifndef __math_Euler_h__ 8 #define __math_Euler_h__ 45 { operator=(quaternion); }
56 using Vector<3,T>::operator=;
62 set(*
this,other[0],other[1],other[2]);
69 const T pi2=T(0.5)*fe::pi-1e-6f;
70 (*this)[1]=asin(-matrix(2,0));
75 (*this)[0]=atan2(matrix(2,1),matrix(2,2));
76 (*this)[2]=atan2(matrix(1,0),matrix(0,0));
82 (*this)[2]=atan2(-matrix(0,1),-matrix(0,2));
89 (*this)[2]= -atan2(matrix(0,1),matrix(0,2));
100 const double sinr_cosp = 2 * (quat[3] * quat[0] + quat[1] * quat[2]);
101 const double cosr_cosp = 1 - 2 * (quat[0] * quat[0] + quat[1] * quat[1]);
102 (*this)[0] = atan2(sinr_cosp, cosr_cosp);
105 const double sinp = 2 * (quat[3] * quat[1] - quat[2] * quat[0]);
109 (*this)[1] = copysign(M_PI / 2, sinp);
113 (*this)[1] = asin(sinp);
117 const double siny_cosp = 2 * (quat[3] * quat[2] + quat[0] * quat[1]);
118 const double cosy_cosp = 1 - 2 * (quat[1] * quat[1] + quat[2] * quat[2]);
119 (*this)[2] = atan2(siny_cosp, cosy_cosp);
128 fe::setIdentity(matrix);
129 rotate(matrix,(*
this)[2],e_zAxis);
130 rotate(matrix,(*
this)[1],e_yAxis);
131 rotate(matrix,(*
this)[0],e_xAxis);
Matrix for 3D transformations.
Definition: Matrix3x4.h:47
kernel
Definition: namespace.dox:3
Dense vector - size fixed by template.
Definition: Vector.h:19
Special vector for concatenated Euler angles.
Definition: Euler.h:31
Four-dimensional complex number.
Definition: Quaternion.h:32