An affine transform performs a linear mapping from 2D coordinates to other 2D coordinates that preserves the “straightness” and “parallelness” of lines. Such a coordinate transformation can be represented by a 3 row by 3 column matrix with an implied last row of [ 0 0 1 ]. This matrix transforms source coordinates (x,y) into destination coordinates (x’,y’) by considering them to be a column vector and multiplying the coordinate vector by the matrix according to the following process: This class is optimized for speed and minimizes calculations based on its knowledge of the underlying matrix (as opposed to say simply performing matrix multiplication). The value that affects the transformation along the x axis when scaling or rotating, positioned at (0, 0) in the transformation matrix. The value that affects the transformation along the y axis when rotating or skewing, positioned at (1, 0) in the transformation matrix. The value that affects the transformation along the x axis when rotating or skewing, positioned at (0, 1) in the transformation matrix. The value that affects the transformation along the y axis when scaling or rotating, positioned at (1, 1) in the transformation matrix. The distance by which to translate along the x axis, positioned at (2, 0) in the transformation matrix. The distance by which to translate along the y axis, positioned at (2, 1) in the transformation matrix. The transform values as an array, in the same sequence as they are passed to initialize(a, c, b, d, tx, ty). Resets the matrix by setting its values to the ones of the identity matrix that results in no transformation. Attempts to apply the matrix to the content of item that it belongs to, meaning its transformation is baked into the item’s content or children. Returns a new instance of the result of the concatenation of the given affine transform with this transform. Returns whether the transform is invertible. A transform is not invertible if the determinant is 0 or any value is non-finite or NaN. Transforms an array of coordinates by this matrix and stores the results into the destination array, which is also returned. Attempts to decompose the affine transformation described by this matrix into scaling, rotation and shearing, and returns an object with these properties if it succeeded, null otherwise. Creates the inversion of the transformation of the matrix and returns it as a new insteance. If the matrix is not invertible (in which case isSingular() returns true), null is returned. Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: March 26, 2015 @ 12:00 am