# gcu::Matrix2D Class Reference

`#include <gcu/matrix2d.h>`

List of all members.

## Public Member Functions

| Matrix2D ()
virtual | ~Matrix2D ()
| Matrix2D (double Angle, bool Deg=true)
| Matrix2D (double x11, double x12, double x21, double x22)
Matrix2D & | operator* (Matrix2D &cMat)
Matrix2D & | operator= (Matrix2D &cMat)
void | Transform (double &dx, double &dy)

## Detailed Description

This class provides some operations related to transformations in a plane. The matrices are 2x2.

Definition at line 34 of file matrix2d.h.

## Constructor & Destructor Documentation

gcu::Matrix2D::Matrix2D | ( |  | ) |

Default constructor. Members are not initialized. This constructor is rarely used.

virtual gcu::Matrix2D::~Matrix2D | ( |  | ) | `[virtual]`

The destructor of Matrix.

gcu::Matrix2D::Matrix2D | ( | double | Angle,
|  | bool | Deg = `true` |
| ) |  |  |

Parameters:

  | Angle,: | rotation angle.
  | Deg,: | if true, Angle is expressed in degrees, otherwise in radians. Default is true.

Constructs a Matrix2D representing a rotation.

gcu::Matrix2D::Matrix2D | ( | double | x11,
|  | double | x12,
|  | double | x21,
|  | double | x22 |
| ) |  |  |

Parameters:

  | x11,: | value to use at first line and first column of the matrix.
  | x12,: | value to use at first line and second column of the matrix.
  | x21,: | value to use at second line and first column of the matrix.
  | x22,: | value to use at second line and second column of the matrix.

Constructs a matrix from its components.

## Member Function Documentation

Matrix2D& gcu::Matrix2D::operator* | ( | Matrix2D & | cMat | ) |

Parameters:

  | cMat,: | a Matrix2D instance to use in the multiplication.

The matricial multiplication operator.

Matrix2D& gcu::Matrix2D::operator= | ( | Matrix2D & | cMat | ) |

Parameters:

  | cMat,: | the Matrix2D instance to copy.

Copies a Matrix instance into another one.

void gcu::Matrix2D::Transform | ( | double & | dx,
|  | double & | dy |
| ) |  |  |

Parameters:

  | dx,: | the x coordinate.
  | dy,: | the y coordinate.

Initially, dx and dy are the components of the vector to transform (multiply) by the matrix and after execution of this method, dx, dy and dz are the components of the transformed vector. So initial values are lost.

The documentation for this class was generated from the following file:

- matrix2d.h