Previous Next


                                        209
SECTION 4.2                                                      Coordinate Systems



space to device space. Recalling that coordinates are always specified in the trans-
formed 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 car-
ried 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′ = M T × 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 coordi-
nates that correspond to a given pair of device space coordinates. Not all transfor-
mations 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 un-
predictable behavior.

Previous Next