Matrix package:cairo
Representation of a 2-D affine transformation.
The Matrix type represents a 2x2 transformation matrix along with a
translation vector.
Matrix a1 a2 b1 b2 c1 c2 describes the
transformation of a point with coordinates x,y that is defined by
/ x' \ = / a1 b1 \ / x \ + / c1 \
\ y' / \ a2 b2 / \ y / \ c2 /
or
x' = a1 * x + b1 * y + c1
y' = a2 * x + b2 * y + c2
Gets the current transformation matrix, as set by
setMatrix.
Resets the current transformation matrix (CTM) by setting it equal to
the identity matrix. That is, the user-space and device-space axes
will be aligned and one user-space unit will transform to one
device-space unit.
Get the pattern's transformation matrix.
Sets the pattern's transformation matrix to matrix. This matrix is a
transformation from user space to pattern space.
When a pattern is first created it always has the identity matrix for
its transformation matrix, which means that pattern space is initially
identical to user space.
Important: Please note that the direction of this transformation
matrix is from user space to pattern space. This means that if you
imagine the flow from a pattern to user space (and on to device
space), then coordinates in that flow will be transformed by the
inverse of the pattern matrix.
Also, please note the discussion of the user-space locking semantics
of
setSource.
Sets the current font matrix to
matrix. The font matrix gives
a transformation from the design space of the font (in this space, the
em-square is 1 unit by 1 unit) to user space. Normally, a simple scale
is used (see
setFontSize), but a more complex font matrix can
be used to shear the font or stretch it unequally along the two axes.
Modifies the current transformation matrix (CTM) by setting it equal
to matrix.