Example #1
0
Matrix3d Rotation3::GetRotationMatrix() const {
  Matrix3d Rm;
  const double& qw = quat_(0);
  const double& qx = quat_(1);
  const double& qy = quat_(2);
  const double& qz = quat_(3);

  Rm << 1 - 2*qy*qy - 2*qz*qz, 2*qx*qy - 2*qz*qw, 2*qx*qz + 2*qy*qw,
       2*qx*qy + 2*qz*qw, 1 - 2*qx*qx - 2*qz*qz, 2*qy*qz - 2*qx*qw,
       2*qx*qz - 2*qy*qw, 2*qy*qz + 2*qx*qw, 1 - 2*qx*qx - 2*qy*qy;

  return Rm;
}
Example #2
0
 ///same as above
 T scalar() const{return quat_(eW);};
Example #3
0
 ///Z
 T Z()     const {return quat_(eZ);};
Example #4
0
 ///Y
 T Y()     const {return quat_(eY);};
Example #5
0
 ///X
 T X()     const {return quat_(eX);};
Example #6
0
 ///W
 T W()     const {return quat_(eW);};