Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Matrix33 Class Reference

3x3 Matrix Used to represent a homogeneous 2D affine transform. More...

#include <Matrix33.h>

List of all members.

Public Types

enum  Matrix33_init { IDENTITY, ZERO }
enum  Matrix33_init_d { ROTATE, SCALE }
enum  Matrix33_init_v { TRANSLATE, SCALE_XY }

Public Methods

 Matrix33 (void)
 Default constructor.

 Matrix33 (Matrix33_init)
 Constructor for operations that take no arguments.

 Matrix33 (Matrix33_init_d, double)
 Constructor for operations that are defined by a double.

 Matrix33 (Matrix33_init_v, const Vector2 &)
 Constructor for operations that are defined by a ZVector2.

void set_zero (void)
 Sets this matrix to the zero matrix.

void set_identity (void)
 Sets this matrix to the identity matrix.

void set_translation (const Vector2 &)
 Sets the elements of this matrix so that it represents a 2D translation of the given vector.

void set_rotation (double angle)
 Sets the elements of this matrix so that it represents a 2D rotation about the origin by the given anti-clockwise angle in radians.

void set_rotation (double angle, const Vector2 &origin)
 Sets the elements of this matrix so that it represents a 2D rotation about 'centre' by the given anti-clockwise angle in radians.

void set_scale (double scale)
 Sets the elements of this matrix so that it represents a 2D scale centred on the origin by the given scale factor.

void set_scale (const Vector2 &scale_xy)
 Sets the elements of this matrix so that it represents a 2D scale centred on the origin by the factors in X and Y given in the ZVector2.

void transform (Vector2 *) const
 Transforms the given Vector2 by this matrix.

Matrix33 operator * (const Matrix33 &) const
 Returns the product of this matrix with the one given.


Private Attributes

double m_elements [3][3]
 Matrix elements, [rows][cols].


Detailed Description

3x3 Matrix Used to represent a homogeneous 2D affine transform.

The standard coordinate space has the Y-axis pointing up. Angles are measured in radians, and increase ACW.


Member Enumeration Documentation

enum Matrix33::Matrix33_init
 

Enumeration values:
IDENTITY 
ZERO 

enum Matrix33::Matrix33_init_d
 

Enumeration values:
ROTATE 
SCALE 

enum Matrix33::Matrix33_init_v
 

Enumeration values:
TRANSLATE 
SCALE_XY 


Constructor & Destructor Documentation

Matrix33::Matrix33 void   
 

Default constructor.

Initialises the matrix to all 0s.

Matrix33::Matrix33 Matrix33_init    type
 

Constructor for operations that take no arguments.

The first argument should be one of the following values: IDENTITY ZERO

Matrix33::Matrix33 Matrix33_init_d    type,
double    value
 

Constructor for operations that are defined by a double.

The first argument should be one of the following values: ROTATE SCALE

Matrix33::Matrix33 Matrix33_init_v    type,
const Vector2   value
 

Constructor for operations that are defined by a ZVector2.

The first argument should be one of the following values: TRANSLATE SCALE_XY


Member Function Documentation

Matrix33 Matrix33::operator * const Matrix33 &    m const
 

Returns the product of this matrix with the one given.

void Matrix33::set_identity void   
 

Sets this matrix to the identity matrix.

void Matrix33::set_rotation double    a,
const Vector2   centre
 

Sets the elements of this matrix so that it represents a 2D rotation about 'centre' by the given anti-clockwise angle in radians.

void Matrix33::set_rotation double    a
 

Sets the elements of this matrix so that it represents a 2D rotation about the origin by the given anti-clockwise angle in radians.

void Matrix33::set_scale const Vector2   s
 

Sets the elements of this matrix so that it represents a 2D scale centred on the origin by the factors in X and Y given in the ZVector2.

void Matrix33::set_scale double    s
 

Sets the elements of this matrix so that it represents a 2D scale centred on the origin by the given scale factor.

void Matrix33::set_translation const Vector2   v
 

Sets the elements of this matrix so that it represents a 2D translation of the given vector.

void Matrix33::set_zero void   
 

Sets this matrix to the zero matrix.

void Matrix33::transform Vector2   v const
 

Transforms the given Vector2 by this matrix.


Member Data Documentation

double Matrix33::m_elements[3][3] [private]
 

Matrix elements, [rows][cols].


The documentation for this class was generated from the following files:
Generated on Sun Jul 21 11:52:18 2002 for FractalViewer by doxygen1.2.16