Transformation Matrix

Transformation Matrix from the PDF Reference:

A transformation matrix in PDF is specified by six numbers, usually in the form of an array containing six elements. In its most general form, this array is denoted [ a b c d e f ] ; it can represent any linear transformation from one coordinate system to another. This section lists the arrays that specify the most common transformations; Section 4.2.3, “Transformation Matrices,” discusses more mathematical details of transformations, including information on specifying transformations that are combinations of those listed here:

  • Translations are specified as [ 1 0 0 1 tx ty ] , where t x and t y are the distances to translate the origin of the coordinate system in the horizontal and vertical dimensions, respectively.
  • Scaling is 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 as s x and s y units, respectively, in the previous coordinate system.
  • Rotations are produced by [ cos θ sin θ −sin θ cos θ 0 0 ] , which has the effect of rotating the coordinate system axes by an angle θ counterclockwise.
  • Skew is specified by [ 1 tan α tan β 1 0 0 ] , which skews the x axis by an angle α and the y axis by an angle β

Modify the current transformation matrix example:

0.060000000 0 0 -0.060000000 0 842 cm