cairo_matrix_t

cairo_matrix_t — Generic matrix operations

Synopsis




            cairo_matrix_t;

Description

cairo_matrix_t is used throughout cairo to convert between different coordinate spaces. A cairo_matrix_t holds an affine transformation, such as a scale, rotation, shear, or a combination of these. The transformation of a point (x,y) is given by:

    x_new = xx * x + xy * y + x0;
    y_new = yx * x + yy * y + y0;
  

The current transformation matrix of a cairo_t, represented as a cairo_matrix_t, defines the transformation from user-space coordinates to device-space coordinates. See cairo_get_matrix() and cairo_set_matrix().

Details

cairo_matrix_t

typedef struct {
    double xx; double yx;
    double xy; double yy;
    double x0; double y0;
} cairo_matrix_t;

A cairo_matrix_t holds an affine transformation, such as a scale, rotation, shear, or a combination of those. The transformation of a point (x, y) is given by:

    x_new = xx * x + xy * y + x0;
    y_new = yx * x + yy * y + y0;

double xx; xx component of the affine transformation
double yx; yx component of the affine transformation
double xy; xy component of the affine transformation
double yy; yy component of the affine transformation
double x0; X translation component of the affine transformation
double y0; Y translation component of the affine transformation