USGS

Isis 3.0 Object Programmers' Reference

Home

Affine.h

Go to the documentation of this file.
00001 #ifndef Affine_h
00002 #define Affine_h
00003 
00025 #include <vector>
00026 #include "tnt_array2d.h"
00027 #include "iException.h"
00028 
00029 namespace Isis {
00078   class Affine {
00079     public:
00080       typedef TNT::Array2D<double> AMatrix;
00081       Affine ();
00082       Affine(const AMatrix &a);
00083       ~Affine ();
00084       void Solve (const double x[], const double y[], 
00085                   const double xp[], const double yp[], int n);
00086       static AMatrix getIdentity();
00087       void Identity ();
00088       void Translate (double tx, double ty);
00089       void Rotate(double rot);
00090       void Scale(double scaleFactor);
00091 
00092       void Compute(double x, double y);
00093 
00095       double xp() const { return p_xp; };  
00096 
00098       double yp() const { return p_yp; };
00099 
00100       void ComputeInverse(double xp, double yp);
00101 
00103       double x() const { return p_x; };
00104 
00106       double y() const { return p_y; };
00107 
00108       std::vector<double> Coefficients( int var );
00109       std::vector<double> InverseCoefficients( int var );
00111       AMatrix Forward() const { return (p_matrix.copy()); }
00113       AMatrix Inverse() const { return (p_invmat.copy()); }
00114 
00115     private:
00116       AMatrix p_matrix;   
00117       AMatrix p_invmat;   
00118 
00119       double p_x;         
00120       double p_y;         
00121       double p_xp;        
00122       double p_yp;        
00123 
00124       void checkDims(const AMatrix &am) const throw (iException &);
00125       AMatrix invert(const AMatrix &a) const throw (iException &);
00126   };
00127 };
00128 
00129 #endif
00130