DrawKit
Vector and illustration framework for Mac OS X
Public Member Functions | List of all members
Geom::Matrix Class Reference

The Matrix class. More...

Public Member Functions

 Matrix ()
 
 Matrix (Matrix const &m)
 
 Matrix (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4, Coord c5)
 
 Matrix (Scale const &sm)
 
 Matrix (Rotate const &r)
 
 Matrix (Translate const &tm)
 
Matrixassign (Coord const *array)
 
Coordcopyto (Coord *array) const
 
Coord descrim () const
 
Coord descrim2 () const
 
Coord det () const
 
double expansion () const
 
double expansionX () const
 
double expansionY () const
 
Matrix inverse () const
 
bool is_rotation (double const eps=Geom_EPSILON) const
 
bool is_scale (double const eps=Geom_EPSILON) const
 
bool is_translation (Coord const eps=Geom_EPSILON) const
 
bool is_uniform_scale (double const eps=Geom_EPSILON) const
 
Matrixoperator*= (Matrix const &other)
 
Matrixoperator*= (Scale const &other)
 
Matrixoperator*= (Translate const &other)
 
Matrixoperator= (Matrix const &m)
 
Coordoperator[] (int const i)
 
Coord operator[] (int const i) const
 
void set_identity ()
 
void set_translation (Point const &loc)
 
void set_x_axis (Point const &vec)
 
void set_y_axis (Point const &vec)
 
bool test_identity () const
 
Point translation () const
 
Point x_axis () const
 
Point y_axis () const
 

Detailed Description

The Matrix class.

For purposes of multiplication, points should be thought of as row vectors

$(p_X p_Y 1)$

to be right-multiplied by transformation matrices of the form

\[ \left[ \begin{array}{ccc} c_0&c_1&0 \\ c_2&c_3&0 \\ c_4&c_5&1 \end{array} \right] \]

(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").

Constructor & Destructor Documentation

Geom::Matrix::Matrix ( )
explicit
Geom::Matrix::Matrix ( Matrix const &  m)
Geom::Matrix::Matrix ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3,
Coord  c4,
Coord  c5 
)
Geom::Matrix::Matrix ( Scale const &  sm)
explicit
Geom::Matrix::Matrix ( Rotate const &  r)
explicit
Geom::Matrix::Matrix ( Translate const &  tm)
explicit

Member Function Documentation

Matrix& Geom::Matrix::assign ( Coord const *  array)
Coord* Geom::Matrix::copyto ( Coord array) const
Coord Geom::Matrix::descrim ( ) const
Coord Geom::Matrix::descrim2 ( ) const
Coord Geom::Matrix::det ( ) const
double Geom::Matrix::expansion ( ) const
double Geom::Matrix::expansionX ( ) const
double Geom::Matrix::expansionY ( ) const
Matrix Geom::Matrix::inverse ( ) const
bool Geom::Matrix::is_rotation ( double const  eps = Geom_EPSILON) const
bool Geom::Matrix::is_scale ( double const  eps = Geom_EPSILON) const
bool Geom::Matrix::is_translation ( Coord const  eps = Geom_EPSILON) const
bool Geom::Matrix::is_uniform_scale ( double const  eps = Geom_EPSILON) const
Matrix& Geom::Matrix::operator*= ( Matrix const &  other)
Matrix& Geom::Matrix::operator*= ( Scale const &  other)
Matrix& Geom::Matrix::operator*= ( Translate const &  other)
Matrix& Geom::Matrix::operator= ( Matrix const &  m)
Coord& Geom::Matrix::operator[] ( int const  i)
Coord Geom::Matrix::operator[] ( int const  i) const
void Geom::Matrix::set_identity ( )
void Geom::Matrix::set_translation ( Point const &  loc)
void Geom::Matrix::set_x_axis ( Point const &  vec)
void Geom::Matrix::set_y_axis ( Point const &  vec)
bool Geom::Matrix::test_identity ( ) const
Point Geom::Matrix::translation ( ) const
Point Geom::Matrix::x_axis ( ) const
Point Geom::Matrix::y_axis ( ) const