Isis 3 Developer Reference
Quaternion.h
Go to the documentation of this file.
1 #ifndef Quaternion_h
2 #define Quaternion_h
3 
27 #include <string>
28 #include <vector>
29 
30 #include <SpiceUsr.h>
31 #include <SpiceZfc.h>
32 #include <SpiceZmc.h>
33 
34 namespace Isis {
52  class Quaternion {
53  public:
54  // constructors
55  Quaternion();
56  Quaternion(const std::vector<double> matrix);
57 
58  // destructor
59  ~Quaternion();
60 
61  //Methods
62 
63  std::vector<double> ToMatrix();
64 
65  std::vector<double> ToAngles(int axis3, int axis2, int axis1);
66 
67  void Set(std::vector<double>);
68 
70  std::vector<double> GetQuaternion() const {
71  return p_quaternion;
72  }
73  ;
74  Quaternion &operator=(const Quaternion &quat);
75 
76  Quaternion &operator*=(const Quaternion &quat);
77 
78  Quaternion operator*(const Quaternion &quat) const;
79 
80  Quaternion operator*(const double &scalar);
81 
95  double &operator[](int index) {
96  return p_quaternion.at(index);
97  };
98 
99 
100 
101  std::vector<double> Qxv(const std::vector<double> &vin);
102 
104 
105 
106 
107 
108  private:
109  std::vector<double> p_quaternion;
110  void Polish(Quaternion &quat);
111  };
112 };
113 
114 #endif
115 
Quaternion & operator=(const Quaternion &quat)
Assign value of quaternion class to another quaternion.
Definition: Quaternion.cpp:111
Provide operations for quaternion arithmetic.
Definition: Quaternion.h:52
void Set(std::vector< double >)
Sets the quaternion value.
Definition: Quaternion.cpp:72
Quaternion operator*(const Quaternion &quat) const
Multiply two Naif quaternions to create a new quaternion.
Definition: Quaternion.cpp:163
Quaternion & operator*=(const Quaternion &quat)
Multiply current Naif quaternion by another Naif quaternion, replacing the current quaternion...
Definition: Quaternion.cpp:133
Quaternion Conjugate()
Returns the conjugate of the quaternion.
Definition: Quaternion.cpp:213
std::vector< double > ToAngles(int axis3, int axis2, int axis1)
Return the camera angles (right ascension, declination, and twist) for the quaternion.
Definition: Quaternion.cpp:276
std::vector< double > ToMatrix()
Converts quaternion to 3x3 rotational matrix.
Definition: Quaternion.cpp:91
std::vector< double > Qxv(const std::vector< double > &vin)
Multiply a vector by a quaternion (rotate the vector)
Definition: Quaternion.cpp:231
Quaternion()
Constructs an empty quaternion.
Definition: Quaternion.cpp:42
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
std::vector< double > GetQuaternion() const
Return the quaternion as a vector.
Definition: Quaternion.h:70
~Quaternion()
Destroys the Quaternion object.
Definition: Quaternion.cpp:65
double & operator[](int index)
Return a member of a quaternion.
Definition: Quaternion.h:95