2-D affine transformation. A transform represents the
matrix
[ x' ] [ xx xy ] [ x ] [ tx ] [ ] = [ ] [ ] + [ ] [ y' ] [ yx yy ] [ y ] [ ty ]
that maps points and areas from a source coordinate space into a
target space. Composition follows the cairo convention: methods such as transform->scale
and transform->rotate
post-multiply the operation into self (self := self * Op),
so the operation is applied to the input
first and the receiver afterwards. A sequence
send(T, scale, 2), send(T, rotate, 30)
therefore rotates a point first and then scales the rotated result.
|tuple], shear=[tuple]num or
tuple(sx, sy)) and shear (tuple(kx, ky)). The
fresh transform starts at identity; the supplied operations are applied
in the fixed order scale, rotate, shear. Following the
post-multiplication convention this means an input point is transformed
shear-first, then rotated, then scaled.
For an arbitrary transform whose six coefficients are known, use
new(T, transform), send(T, set, XX, XY, YX, YY, TX, TY)
self := self * translate(dx,dy).sy is
omitted the same factor is used for both axes.[1 kx; ky 1].self := self * argument.|area -> point|areapoint through the transform, or compute the
axis-aligned bounding box of an area mapped through it.
Results that are within float-roundoff of an integer are snapped to that
integer so that exact 90/180/270 degree rotations of integer-aligned
inputs yield integer-aligned outputs.