  | 
  
    Isis 3 Programmer Reference
    
   | 
 
 
 
 
    8 #include "Quaternion.h" 
   18 #include "IException.h" 
   20 #include "NaifStatus.h" 
   29     for(
int i = 0;  i < 4;  i++) {
 
   58     if(rotation.size() == 9) {        
 
   63     else if(rotation.size() == 4) {   
 
   67       std::string msg = 
"Input vector of unexpected size for matrix or quaternion";
 
   76     std::vector<double> matrix(9);
 
   77     q2m_c(&
p_quaternion[0], (SpiceDouble( *)[3]) &matrix[0]);
 
  118     std::vector<double> qout(4);
 
  122           (SpiceDouble *) & (qout[0]));
 
  175     double scalar2 = scalar * scalar;
 
  179       unitizer  =  sqrt(unitizer);
 
  182       std::string msg = 
"Unable to make quaternion a unit quaternion";
 
  188     for(
int i = 1;  i < 4;  i++) {
 
  201     for(
int i = 1;  i < 4;  i++) {
 
  216     if(vin.size() != 3) {
 
  217       std::string msg = 
"Unexpected vector size -- 3 expected";
 
  261     std::vector<double> rotationMatrix = 
ToMatrix();
 
  262     SpiceDouble ang1, ang2, ang3;
 
  264     m2eul_c((SpiceDouble *) &rotationMatrix[0], axis3, axis2, axis1,
 
  265             &ang3, &ang2, &ang1);
 
  267     std::vector<double> angles;
 
  268     angles.push_back(ang1);
 
  269     angles.push_back(ang2);
 
  270     angles.push_back(ang3);
 
  
 
Quaternion & operator*=(const Quaternion &quat)
Multiply current Naif quaternion by another Naif quaternion, replacing the current quaternion.
 
std::vector< double > ToMatrix()
Converts quaternion to 3x3 rotational matrix.
 
std::vector< double > Qxv(const std::vector< double > &vin)
Multiply a vector by a quaternion (rotate the vector)
 
Quaternion()
Constructs an empty quaternion.
 
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
 
Quaternion & operator=(const Quaternion &quat)
Assign value of quaternion class to another quaternion.
 
std::vector< double > p_quaternion
Quaternion.
 
Quaternion operator*(const Quaternion &quat) const
Multiply two Naif quaternions to create a new quaternion.
 
~Quaternion()
Destroys the Quaternion object.
 
void Set(std::vector< double >)
Sets the quaternion value.
 
void Polish(Quaternion &quat)
Polish the quaternion – make the first component positive.
 
Provide operations for quaternion arithmetic.
 
@ Programmer
This error is for when a programmer made an API call that was illegal.
 
Quaternion Conjugate()
Returns the conjugate of the quaternion.
 
std::vector< double > ToAngles(int axis3, int axis2, int axis1)
Return the camera angles (right ascension, declination, and twist) for the quaternion.
 
This is free and unencumbered software released into the public domain.