# Matrix

## Object Hierarchy:

## Description:

[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "pango_matrix_get_type ()" ) ]

[ Version ( since = "1.6" ) ]

public struct **Matrix**

A structure specifying a transformation between user-space coordinates and device coordinates.

The transformation is given by

`x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;`

y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;

## Content:

### Methods:

- public void
**concat** (Matrix new_matrix)
Changes the transformation represented by this
to be the transformation given by first applying transformation given by `new_matrix`

then applying the original
transformation.

- public Matrix?
**copy** ()
Copies a Matrix.

- public void
**free** ()
Free a Matrix created with
copy.
- public double
**get_font_scale_factor** ()
Returns the scale factor of a matrix on the height of the font.

- public void
**get_font_scale_factors** (out double xscale, out double yscale)
Calculates the scale factor of a matrix on the width and height of the font.

- public void
**rotate** (double degrees)
Changes the transformation represented by this
to be the transformation given by first rotating by `degrees`

degrees counter-clockwise then applying the original
transformation.

- public void
**scale** (double scale_x, double scale_y)
Changes the transformation represented by this
to be the transformation given by first scaling by `sx`

in the X direction and `sy`

in the Y direction then
applying the original transformation.

- public void
**transform_distance** (ref double dx, ref double dy)
Transforms the distance vector (`dx`

,`dy`

) by
this.

- public void
**transform_pixel_rectangle** (ref Rectangle? rect)
First transforms the `rect`

using this
, then calculates the bounding box of the transformed rectangle.

- public void
**transform_point** (ref double x, ref double y)
Transforms the point (`x`

, `y`

) by
this.

- public void
**transform_rectangle** (ref Rectangle? rect)
First transforms `rect`

using this
, then calculates the bounding box of the transformed rectangle.

- public void
**translate** (double tx, double ty)
Changes the transformation represented by this
to be the transformation given by first translating by (`tx`

, `ty`

) then applying the original transformation.

### Fields: