Transformation of coordinates from one two-dimensional coordinate system to another can be specified by means of a 3x3 transformation matrix. The matrix specifies how a point in one coordinate system is transformed into the corresponding point in another coordinate system.
![[1kb 73x69 GIF] [1kb 73x69 GIF]](images/transform_before.gif) 
The subsequent definitions of the geometric transformations are illustrated with the example polygon in the margin.
A transformation matrix(TM) specifies a transformation of point (x,y) to point (x', y') in the following way:
![[1kb 207x38 GIF] [1kb 207x38 GIF]](images/transformation_eqn.gif)
![[1kb 101x36 GIF] [1kb 101x36 GIF]](images/TM.gif)
The common transformations: scaling, moving (translation), and rotation can easily be described by transformation matrices.
![[1kb 86x110 GIF] [1kb 86x110 GIF]](images/transform_scale.gif) 
Scaling by factor sx in the x dimension and sy in the y dimension is accomplished by:
![[1kb 104x34 GIF] [1kb 104x34 GIF]](images/TM_scale.gif)
![[1kb 75x86 GIF] [1kb 75x86 GIF]](images/transform_move.gif) 
Moving (translation) by a specified displacement (tx,ty) is obtained by
![[1kb 120x36 GIF] [1kb 120x36 GIF]](images/TM_move.gif)
![[1kb 73x68 GIF] [1kb 73x68 GIF]](images/transform_rotate.gif) 
 Rotating counterclockwise, around the origin of the coordinate system, by an angle ![[827 bytes 5x9 GIF] [Theta] 
[827 bytes 5x9 GIF]](images/theta.gif) is described by the following matrix:
 is described by the following matrix:
![[1kb 141x34 GIF] [1kb 141x34 GIF]](images/TM_rotate.gif)
The most powerful feature of the matrix application, is that composition of geometric transformations can be expressed as multiplications of the corresponding matrices. That is, a combination of a rotate, move, and scale transformation can be combined into one matrix, and thus reduce the time of calculation of a complex transformation:
![[2kb 357x33 GIF] [2kb 357x33 GIF]](images/TM_combined.gif)
The user must be aware of the order of transformations, since matrix multiplication is not commutative. For a more thorough explanation of matrix operations and transformations, see e.g. [Newman 81].
| The Bifrost Graphics System - Reference Manual | © 1991-2002 Mjølner Informatics | [Modified: Tuesday October 24th 2000 at 15:02]
 |