FS_MATRIX Class 
Namespace: Patagames.Pdf
The FS_MATRIX type exposes the following members.
Name  Description  

FS_MATRIX 
Initialize a new instance of FS_MATRIX class
 
FS_MATRIX(PdfTypeBase) 
Initializes a new instance of the FS_MATRIX structure with the specified array.
 
FS_MATRIX(Double, Double, Double, Double, Double, Double) 
Initialize a new instance of FS_MATRIX class
 
FS_MATRIX(Single, Single, Single, Single, Single, Single) 
Initialize a new instance of FS_MATRIX class

Name  Description  

Concat 
Multiplies this matrix by the matrix specified in the matrix parameter, and in the order specified in the prepended parameter.
 
ConcatInverse 
Inverts the matrix specified in the matrix parameter and than multiplies this matrix by the inverted matrix, and in the order specified in the prepended parameter.
 
GetReverse 
Inverts this Matrix, if it is invertible and return as a new Matrix.
 
GetUnitArea 
Get unit area
 
GetXUnit 
Get x unit
 
GetYUnit 
Get y unit
 
Is90Rotated 
Gets a value indicating whether this Matrix is rotated.
 
IsIdentity 
Gets a value indicating whether this Matrix is the identity matrix.
 
IsInvertible 
Gets a value indicating whether this Matrix is invertible.
 
IsScaled 
Gets a value indicating whether this Matrix is scaled.
 
Rotate(Single, Boolean) 
Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix.
 
Rotate(Single, Single, Single, Boolean) 
Applies a clockwise rotation about the specified point to this Matrix in the specified order.
 
Scale 
Applies the specified scale vector (sx and sy) to this Matrix using the specified order.
 
SetIdentity 
Initializes this instance of the FS_MATRIX class as the identity matrix.
 
SetReverse 
Inverts this matrix, if it is invertible.
 
SetReverse(FS_MATRIX) 
Inverts the specified matrix, if it is invertible and set it to this matrix.
 
Shear 
Applies the specified shear vector to this Matrix in the specified order.
 
ToArray 
Returns a PdfTypeArray representation of the matrix.
 
TransformDistance(Single) 
Applies the geometric transform represented by this Matrix to a distance.
 
TransformDistance(Int32, Int32) 
Applies the geometric transform represented by this Matrix to a distance.
 
TransformDistance(Single, Single) 
Applies the geometric transform represented by this Matrix to a distance.
 
TransformPoint(Int32, Int32) 
Applies the geometric transform represented by this Matrix to a specified point.
 
TransformPoint(Single, Single) 
Applies the geometric transform represented by this Matrix to a specified point.
 
TransformRect 
Applies the geometric transform represented by this Matrix to a specified rectangle.
 
TransformVector 
Applies only the scale and rotate components of this Matrix to the specified point.
 
TransformXDistance(Int32) 
Applies the geometric transform represented by this Matrix to a xcoordinate of the distance vector.
 
TransformXDistance(Single) 
Applies the geometric transform represented by this Matrix to a xcoordinate of the distance vector.
 
TransformYDistance(Int32) 
Applies the geometric transform represented by this Matrix to a ycoordinate of the distance vector.
 
TransformYDistance(Single) 
Applies the geometric transform represented by this Matrix to a ycoordinate of the distance vector.
 
Translate(Int32, Int32, Boolean) 
Applies the specified translation vector to this Matrix in the specified order.
 
Translate(Single, Single, Boolean) 
Applies the specified translation vector to this Matrix in the specified order.

Name  Description  

a 
Coefficient a.
 
b 
Coefficient b.
 
c 
Coefficient c.
 
d 
Coefficient d.
 
e 
Coefficient e.
 
f 
Coefficient f.

Note 

Many computer graphics textbooks consider transformations of graphics objects rather than of coordinate systems. Although either approach is correct and selfconsistent, some details of the calculations differ depending on which point of view is taken. 
PDF represents coordinates in a twodimensional space. The point (x, y) in such a space can be expressed in vector form as [x y 1]. The constant third element of this vector (1) is needed so that the vector can be used with 3by3 matrices in the calculations described below.
The transformation between two coordinate systems is represented by a 3by3 transformation matrix written as follows:
a b 0 c d 0 e f 1
Because a transformation matrix has only six elements that can be changed, it is usually specified in PDF as the sixelement array [a b c d e f ].
Coordinate transformations are expressed as matrix multiplications:
a b 0 [ x′ y′ 1 ] = [ x y 1 ] x c d 0 e f 1
Because PDF transformation matrices specify the conversion from the transformed coordinate system to the original (untransformed) coordinate system, x′ and y′ in this equation are the coordinates in the untransformed coordinate system, and x and y are the coordinates in the transformed system. The multiplication is carried out as follows:
x′ = a × x + c × y + e y′ = b × x + d × y + f
If a series of transformations is carried out, the matrices representing each of the individual transformations can be multiplied together to produce a single equivalent matrix representing the composite transformation
Matrix multiplication is not commutative — the order in which matrices are multiplied is significant. Consider a sequence of two transformations: a scaling transformation applied to the user space coordinate system, followed by a conversion from the resulting scaled user space to device space. Let Ms be the matrix specifying the scaling and Mc the current transformation matrix, which transforms user space to device space. Recalling that coordinates are always specified in the transformed space, the correct order of transformations must first convert the scaled coordinates to default user space and then the default user space coordinates to device space. This can be expressed as
Xd = Xu × Mc = (Xs × Ms) × Mc = Xs × (Ms × Mc)where
Xd denotes the coordinates in device space
Xu denotes the coordinates in default user space
Xs denotes the coordinates in scaled user space
This shows that when a new transformation is concatenated with an existing one, the matrix representing it must be multiplied before (premultiplied with) the existing transformation matrix.
This result is true in general for PDF: when a sequence of transformations is carried out, the matrix representing the combined transformation (M′) is calculated by premultiplying the matrix representing the additional transformation (Mt) with the one representing all previously existing transformations (M):
M′ = Mt × M
Note 

When rendering graphics objects, it is sometimes necessary for an application to perform the inverse of a transformation—that is, to find the user space coordinates that correspond to a given pair of device space coordinates. Not all transformations are invertible, however. For example, if a matrix contains a, b, c, and d elements that are all zero, all user coordinates map to the same device coordinates and there is no unique inverse transformation. Such noninvertible transformations are not very useful and generally arise from unintended operations, such as scaling by 0. Use of a noninvertible matrix when painting graphics objects can result in unpredictable behavior. 