# Matrix2C

# Class hierarchy

Matrix2C

# Overview

Matrix2C class defines a 2 by 3 matrix class which is used by the Demopaja system The matrix class implements standard set of methods and overdriven operators for easy use.

This class is implemented by the system.

Header: | Matrix2C.h
Library: | core.lib

# Class members

`Matrix2C( const float32* pMat );`

#### Parameters

pMat
  A pointer to array of floating point values which defines the matrix.

#### Remarks

Creates a new vector with the values as the array pointed by the argument. The array should contain 6 values, 2 for each row in the matrix. The rows are in the array continously.

`Matrix2C operator*( const Matrix2C& rMat ) const;`

#### Remarks

Multiplies two matrices and returns the result.

`Matrix2C& operator*=( const Matrix2C& rMat ) const;`

#### Remarks

Multiplies two matrices and stores the result.

`Vector2C& operators[]( int32 i );`

`Vector2C& operators[]( int32 i );`

#### Parameters

i
  Index to the row in the matrix. Range 0..2

#### Return value

Reference to the vector at a row pointed by the index.

#### Remarks

The index values from 0 to 2 corresponds to the rows in the matrix. There are two versions of this method, the first enables to assign values and the second is for retrieving the values.

#### Example

`Matrix2C& set_identity();`

#### Return value

Reference to the matrix.

#### Remarks

Sets the matrix as identity matrix

`Matrix2C& set_trans( const Vector2C& rVec );`

#### Parameters

rVec
  Reference to the vector specifying the position.

#### Remarks

Sets the matrix to identity and then translates the matrix to the value of the argument.

`Matrix2C& set_scale( const Vector2C& rVec );`

#### Parameters

rVec
  Reference to the vector specifying the scale.

#### Remarks

Sets the matrix to identity and then scales the matrix to the value of the argument.

`Matrix2C& set_rot( float32 f32Angle );`

#### Parameters

f32Angle
  Real number specifying the rotation in radians.

#### Remarks

Sets the matrix to identity and then rotates the matrix to the value of the argument.

`friend Vector2C operator*( const Matrix2C& rMat> const Vector2C& rVec> );`

#### Remarks

Multiplies the specified vector by the specified matrix and returns the result.

`friend Vector2C operator*( const Vector2C& rVec> const Matrix2C& rMat> );`

#### Remarks

Multiplies the specified vector by the specified matrix and returns the result.

`friend Vector2C operator*( const Vector2C& rVec> const Matrix2C& rMat> );`

#### Remarks

Multiplies the specified vector by the specified matrix and stores the result to the vector.

`Matrix2C pre_trans( const Vector2C& rVec ) const;`

#### Remarks

Pretranslates the matrix and returns the result.

`Matrix2C invert() const;`

#### Remarks

Inverts the matrix and returns the result.

`Matrix2C transpose() const`

#### Remarks

Transposes the matrix and returns the result.

`Matrix2C ortho_norm() const`

#### Remarks

Ortho normalizes the matrix and returns the result.

Copyright © 2000 Moppi Productions