Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Identity = Matrix{1, 0, 0, 1, 0, 0}
Identity is the identity transformation.
var Zero = Matrix{0, 0, 0, 0, 0, 0}
Zero is an uninitialized transformation.
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix [6]float64
Matrix contains a PDF transformation matrix. The elements are stored in the same order as for the "cm" operator.
A matrix object M = [a b c d e f] corresponds to the following 3x3 matrix:
/ a b 0 \ | c d 0 | \ e f 1 /
A vector (x, y, 1) is transformed by M into
(x y 1) * M = (a*x+c*y+e, b*x+d*y+f, 1)
func Scale ¶
Scale scales the coordinate system.
Drawing the unit square [0, 1] x [0, 1] after applying this transformation is equivalent to drawing the rectangle [0, xScale] x [0, yScale] in the original coordinate system.
func Translate ¶
Translate moves the origin of the coordinate system.
Drawing the unit square [0, 1] x [0, 1] after applying this transformation is equivalent to drawing the rectangle [dx, dx+1] x [dy, dy+1] in the original coordinate system.