1 #ifndef __Geom_MATRIX_H__
2 #define __Geom_MATRIX_H__
53 for(
int i = 0; i < 6; i++) {
59 _c[0] = c0; _c[1] = c1;
60 _c[2] = c2; _c[3] = c3;
61 _c[4] = c4; _c[5] = c5;
65 for(
int i = 0; i < 6; i++)
70 inline Coord operator[](
unsigned const i)
const {
return _c[i]; }
71 inline Coord &operator[](
unsigned const i) {
return _c[i]; }
77 void setXAxis(
Point const &vec);
78 void setYAxis(
Point const &vec);
83 void setExpansionX(
double val);
84 void setExpansionY(
double val);
88 bool isIdentity(
Coord eps = EPSILON)
const;
91 bool isScale(
double eps = EPSILON)
const;
93 bool onlyScaleAndTranslation(
double eps = EPSILON)
const;
109 inline std::ostream &operator<< (std::ostream &out_file,
const Geom::Matrix &m) {
110 out_file <<
"A: " << m[0] <<
" C: " << m[2] <<
" E: " << m[4] <<
"\n";
111 out_file <<
"B: " << m[1] <<
" D: " << m[3] <<
" F: " << m[5] <<
"\n";
138 inline bool operator==(Matrix
const &a, Matrix
const &b) {
139 for(
unsigned i = 0; i < 6; ++i) {
140 if ( a[i] != b[i] )
return false;
144 inline bool operator!=(Matrix
const &a, Matrix
const &b) {
return !( a == b ); }
bool isUniformScale(double eps=EPSILON) const
Definition: matrix.cpp:140
Matrix identity()
Definition: matrix.h:132
double expansionY() const
Definition: matrix.cpp:81
double Coord
Definition: coord.h:45
Point translation() const
Definition: matrix.cpp:48
bool isScale(double eps=EPSILON) const
Definition: matrix.cpp:130
void setIdentity()
Definition: matrix.cpp:102
bool isRotation(double eps=EPSILON) const
Definition: matrix.cpp:150
double expansionX() const
Definition: matrix.cpp:73
Coord descrim() const
Definition: matrix.cpp:207
Coord descrim2() const
Definition: matrix.cpp:202
Matrix elliptic_quadratic_form(Matrix const &m)
Definition: matrix.cpp:224
bool isTranslation(Coord eps=EPSILON) const
Definition: matrix.cpp:120
Matrix inverse() const
Definition: matrix.cpp:174
Cartesian point.
Definition: point.h:20
Matrix without_translation() const
Definition: matrix.cpp:165
Coord det() const
Definition: matrix.cpp:195
void setTranslation(Point const &loc)
Definition: matrix.cpp:64
Matrix from_basis(Point const x_basis, Point const y_basis, Point const offset)
Definition: matrix.cpp:32