happypdf / TransformationMatrix
Type Alias: TransformationMatrix
ts
type TransformationMatrix = [number, number, number, number, number, number];Defined in: src/types/matrix.ts:20
A transformation matrix according to section 8.3.3 Common Transformations of the PDF specification (page 117).
To cite from the spec:
- Translations shall be specified as
[1 0 0 1 tx ty], wheretxandtyshall be the distances to translate the origin of the coordinate system in the horizontal and vertical dimensions, respectively. - Scaling shall be obtained by
[sx 0 0 sy 0 0]. This scales the coordinates so that 1 unit in the horizontal and vertical dimensions of the new coordinate system is the same size assxandsyunits, respectively, in the previous coordinate system. - Rotations shall be produced by
[cos(q) sin(q) -sin(q) cos(q) 0 0], which has the effect of rotating the coordinate system axes by an angleqcounter clockwise. - Skew shall be specified by
[1 tan(a) tan(b) 1 0 0], which skews the x-axis by an angleaand the y axis by an angleb.