Isis 3.0 Programmer Reference
Back | Home
Affine.h
Go to the documentation of this file.
1 #ifndef Affine_h
2 #define Affine_h
3 
25 #include <vector>
26 #include "tnt/tnt_array2d.h"
27 
28 namespace Isis {
79  class Affine {
80  public:
81  typedef TNT::Array2D<double> AMatrix;
82  Affine();
83  Affine(const AMatrix &a);
84  ~Affine();
85  void Solve(const double x[], const double y[],
86  const double xp[], const double yp[], int n);
87  static AMatrix getIdentity();
88  void Identity();
89  void Translate(double tx, double ty);
90  void Rotate(double rot);
91  void Scale(double scaleFactor);
92 
93  void Compute(double x, double y);
94 
96  double xp() const {
97  return p_xp;
98  };
99 
101  double yp() const {
102  return p_yp;
103  };
104 
105  void ComputeInverse(double xp, double yp);
106 
108  double x() const {
109  return p_x;
110  };
111 
113  double y() const {
114  return p_y;
115  };
116 
117  std::vector<double> Coefficients(int var);
118  std::vector<double> InverseCoefficients(int var);
120  AMatrix Forward() const {
121  return (p_matrix.copy());
122  }
124  AMatrix Inverse() const {
125  return (p_invmat.copy());
126  }
127 
128  private:
129  AMatrix p_matrix;
130  AMatrix p_invmat;
131 
132  double p_x;
133  double p_y;
134  double p_xp;
135  double p_yp;
136 
137  void checkDims(const AMatrix &am) const;
138  AMatrix invert(const AMatrix &a) const;
139  };
140 };
141 
142 #endif
143 
double y() const
Returns the computed y.
Definition: Affine.h:113
void Scale(double scaleFactor)
Apply a scale to the current affine transform.
Definition: Affine.cpp:187
void Translate(double tx, double ty)
Apply a translation to the current affine transform.
Definition: Affine.cpp:147
double p_y
y value of the (x,y) coordinate
Definition: Affine.h:133
Affine()
Constructs an Affine transform.
Definition: Affine.cpp:43
AMatrix Inverse() const
Returns the inverse Affine matrix.
Definition: Affine.h:124
double x() const
Returns the computed x.
Definition: Affine.h:108
double p_yp
y&#39; value of the (x&#39;,y&#39;) coordinate
Definition: Affine.h:135
double p_x
x value of the (x,y) coordinate
Definition: Affine.h:132
void Rotate(double rot)
Apply a translation to the current affine transform.
Definition: Affine.cpp:164
void Identity()
Set the forward and inverse affine transform to the identity.
Definition: Affine.cpp:86
double p_xp
x&#39; value of the (x&#39;,y&#39;) coordinate
Definition: Affine.h:134
void Compute(double x, double y)
Compute (xp,yp) given (x,y).
Definition: Affine.cpp:204
std::vector< double > Coefficients(int var)
Return the affine coeffients for the entered variable (1 or 2).
Definition: Affine.cpp:231
Affine basis function.
Definition: Affine.h:79
AMatrix Forward() const
Returns the forward Affine matrix.
Definition: Affine.h:120
AMatrix p_matrix
Affine forward matrix.
Definition: Affine.h:129
void checkDims(const AMatrix &am) const
Checks affine matrix to ensure it is a 3x3 standard form transform.
Definition: Affine.cpp:260
AMatrix invert(const AMatrix &a) const
Compute the inverse of a matrix.
Definition: Affine.cpp:280
AMatrix p_invmat
Affine inverse matrix.
Definition: Affine.h:130
double yp() const
Returns the computed y&#39;.
Definition: Affine.h:101
static AMatrix getIdentity()
Return an Affine identity matrix.
Definition: Affine.cpp:74
std::vector< double > InverseCoefficients(int var)
Return the inverse affine coeffients for the entered variable (1 or 2).
Definition: Affine.cpp:246
void Solve(const double x[], const double y[], const double xp[], const double yp[], int n)
Given a set of coordinate pairs (n &gt;= 3), compute the affine transform that best fits the points...
Definition: Affine.cpp:105
double xp() const
Returns the computed x&#39;.
Definition: Affine.h:96
void ComputeInverse(double xp, double yp)
Compute (x,y) given (xp,yp).
Definition: Affine.cpp:218
~Affine()
Destroys the Affine object.
Definition: Affine.cpp:67

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:14:05