More complex geometric and coordinate transformation can be built from the basic transformation by using the process of composition of function. Transformation with respect to a selected fixed position (h,k) using a scaling function that can only scale relative to the coordinate origin are:
1) Translate the object so that its center coincides with the origin.
2) Scale the object with respect to origin.
3) Translate the scale object back to the original position.
Thus the scaling with respect to the point can be formed by transformation.
S,P = T•S•T^-1
We can generate rotation about any selected pivot point (x,y) by performing following sequence of translate-rotate-translate operation.
1) Translate the object so that pivot point position is move to the coordinate origin.
2) Rotate the object about the coordinate origin.
3) Translate the object so that the pivot point is returned to the original position.
Thus the rotation about a point P can be formed by the transformation
R = T•R•T^-1
Let line L has a y intercept (0,b) and angle of inclination θ. Then the reflection of an object about a line L needs to follow the following:
1) Translate the intersection point to the origin.
2) Rotate by -θ so that line L align with x-axis.
3) Mirror reflects around the x-axis.
4) Rotate back by θ.
5) Translate the origin back to the point (0,b)
In translation notation, we have
M = T R M R T
Note: We must be able to represent the basic transformation as 3x3 homogeneous coordinate matrices so as to be compatible with the matrix of transformation. This is accomplished by augmenting the 2x2 matrix with the third column [0 0 1] (this supposed be a column).
With the matrix representations of the transformations, we can set up a matrix for any sequence of transformations as a composite transformation matrix by calculating the matrix product of the individual transformations.
If two successive transformations T1 and T2 are applied to a coordinate position P, the final transformed location P' is calculated as:
(P•T1)T2 = P(T1•T2)
= P(T)
Where
T = (T1•T2)
A composite transformation is a sequence of transformations, one followed by the other. Consider the matrices and transformations in the following list:
Matrix A = Rotate 90 degrees
Matrix B = Scale by a factor of 2 in the x direction
Matrix C = Translate 3 units in the y direction
If you start with the point (2, 1) — represented by the matrix [2 1 1] — and multiply by A, then B, then C, the point (2,1) will undergo the three transformations in the order listed.
[2 1 1]ABC = [–2 5 1]
Rather than store the three parts of the composite transformation in three separate matrices, you can multiply A, B, and C together to get a single 3 × 3 matrix that stores the entire composite transformation. Suppose ABC = D. Then a point multiplied by D gives the same result as a point multiplied by A, then B, then C.
[2 1 1]D = [–2 5 1]
The fact that the matrix of a composite transformation can be formed by multiplying the individual transformation matrices means that any sequence of affine transformations can be stored in a single Matrix object.
Note: The order of a composite transformation is important. In general, rotate, then scale, then translate is not the same as scale, then rotate, then translate. Similarly, the order of matrix multiplication is important. In general, ABC is not the same as BAC.
I hope this will answer your question :-)