matrix.h revision 8001ba81cb851b38d86650a2fef5817facffb763
#ifndef __Geom_MATRIX_H__
#define __Geom_MATRIX_H__
/** \file
* Definition of Geom::Matrix types.
*
* Main authors:
* Lauris Kaplinski <lauris@kaplinski.com>:
* Original NRMatrix definition and related macros.
*
* Nathan Hurst <njh@mail.csse.monash.edu.au>:
* Geom::Matrix class version of the above.
*
* Michael G. Sloan <mgsloan@gmail.com>:
* Reorganization and additions.
*
* This code is in public domain.
*/
//#include <glib/gmessages.h>
/**
* The Matrix class.
*
* For purposes of multiplication, points should be thought of as row vectors
*
* \f$(p_X p_Y 1)\f$
*
* to be right-multiplied by transformation matrices of the form
* \f[
\left[
\begin{array}{ccc}
c_0&c_1&0 \\
c_2&c_3&0 \\
c_4&c_5&1
\end{array}
\right]
\f]
* (so the columns of the matrix correspond to the columns (elements) of the result,
* and the rows of the matrix correspond to columns (elements) of the "input").
*/
Matrix() {}
for(int i = 0; i < 6; i++) {
_c[i] = m[i];
}
}
}
for(int i = 0; i < 6; i++)
return *this;
}
Point translation() const;
double expansionX() const;
double expansionY() const;
void setExpansionX(double val);
void setExpansionY(double val);
void setIdentity();
bool flips() const;
Matrix without_translation() const;
};
/** A function to print out the Matrix (for debugging) */
return out_file;
}
/** Given a matrix m such that unit_circle = m*x, this returns the
* quadratic form x*A*x = 1. */
/** Given a matrix (ignoring the translation) this returns the eigen
* values and vectors. */
double values[2];
};
// Matrix factories
/** Returns the Identity Matrix. */
0.0, 1.0,
0.0, 0.0);
}
for(unsigned i = 0; i < 6; ++i) {
if ( a[i] != b[i] ) return false;
}
return true;
}
} /* namespace Geom */
#endif /* !__Geom_MATRIX_H__ */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :