Pages

Monday, July 18, 2011

11.1 – Transformation

A transformation is a correspondence between 2 sets of points in a plane. A transformation M is described as a linear transformation of n-dimensional space when it has the properties

T(λx) = λT(x), and
T(λx + μy) = λT(x) + μT(y)

where λ and μ are arbitrary constants.

Recalling your Form 4 Mathematics, you learned how to find the image of points on the Cartesian plane under a certain transformation. Here you will further learn how to use matrices and some simple linear algebra to represent transformations in 2 dimensions only.


An equation of a transformation looks like this:
image

where M is a matrix of transformation. The matrix M,
image
will determine how the point (x, y) will transform into its image (x’, y’). The matrix M is easy to compose. Basically,
image

where (1, 0) and (0, 1) are the unit vectors of directions x and y respectively (or rather, you can treat these 2 vectors as points on the x and y plane). For example, if I want to transform the point (1, 0) to (2, 0), and the point (0, 1) to (0, 2), then my matrix of transformation will be
image

So if you want to find the transformation of a unit box, (0, 0), (1, 0), (0, 1) and (1, 1), just use this matrix and pre-multiply with the points, then you will get the image of the transformation. An example will be given in the next section.


Knowing how a transformation matrix works, we now want to learn how to represent a few types of linear transformation with 2 × 2 matrix. We learned the 3 isometries: translation, rotation and reflection in Form 4. Now we will go through them again, and then we will learn some new ones too. By the way, an isometry is a distance-preserving map between metric spaces. Geometric figures which can be related by an isometry are called congruent. This means that, after an isometric transformation, the area remains unchanged.

1. Translation
image

Translation is just the moving of coordinates, moving of an object from one point to another, without altering its size, shape and orientation. The matrix below will represent a transformation
image 

where a and b will be the amount of shift of the object. (1, 2) will translate the point (x, y) one step right and 2 steps upward and vice versa.


2. Rotation
image

Given an angle, a point is rotated along the origin either clockwise or anticlockwise. A rotation, once the angle being known, could be represented by the matrix
image

Note that this rotation restricts to rotation about the origin only. We will discuss later what to do if the point of rotation is not zero. The area and the shape of the object is unchanged, and once rotated about 360o, the object gets back to its initial position.

3. Reflection
image

For a reflection, you need a line which acts like a “mirror”, such that the whole image reflects to the other side of the the line, equidistance and perpendicular to that line. This line, in this case, must pass through the origin. Again, the shape of the object doesn’t change, and so is the area. A few common reflection matrices are as follows:
image

  along x-axis               along y-axis         along the line y = x

It is actually a little tedious to find the matrix of reflection with only given a line in the form of y=mx. First, you find the normal line, y = – m-1x + c. Substitute the points (1, 0) and (0, 1) to find two parallel normal lines, which passes through these 2 points. Next, you find the intersection point of these 2 lines, with the  line of reflection. Taking that intersection point as the mid point, you probably know how to figure out where the reflected points of (1, 0) and (0,1) are, and thus completing your matrix.

But there is a faster way. Let the line of reflection y = mx be written in the form of y=(tan θ)x. We see that the gradient m = tan θ. With this information, we find θ, and the reflection matrix is just represented by
image

You can try figuring out why this is true. This has something to do with the angles subtended from the point to the origin, then the angle of the line, the uses of cosine and sine and etc. To find cos 2θ and sin 2θ, you could either calculate θ, or you might want to make use of some trigonometric identities.

4. Scaling
image

Scaling does not preserve the size, but it preserves the ratio of the object. This scaling starts from the origin. Scaling can be represented by the matrix
image

where a is a constant. If |a| > 1, then it is an enlargement. If |a| < 1, then it is a contraction, that means the size decreases. A negative value of a makes the object enlarge or contract at another direction. In the case of the red box above, it will enlarge in the 3rd quadrant instead of the 1st. a also represents the factor of enlargement. a = 2 means that the image will be twice as large as the object, and vice versa.

5. Stretch
image

A stretch looks similar to an enlargement, but this time, the ratio of the sides and shape is not preserved. It can be a stretch along the x-axis, along the y-axis, or a stretch along both axis, with different proportions. A stretch is represented as below:

image
along x-axis             along y-axis

You probably could have guessed that for values of |a| < 1 turns the stretch into a compression, while a negative value of a stretches the object the other way. For a stretch, it really doesn’t matter whether it stretches from the origin or some other point, as they are the same anyway.

6. Shear
image

A shear deforms a shape a little. It turns a square into a rhombus, as shown above. It looks like as if we are flattening something sideways. The shear can be represented by the matrices below:
image
parallel to x-axis             parallel to y-axis       2-way shear at different angles

The angle θ is calculated from the opposite axis. For example, the box above undergoes a shear parallel to the x-axis, and the angle is calculated clockwise from the positive y-axis. If the angle was 45o, we say that it is a shear of 45o parallel to the x-axis. Conversely, it can be a shear of xo parallel to the y-axis, which looks like the one below:
image

The shear depends on the origin too.


WHEN THE REFERENCE POINT IS NOT THE ORIGIN

As I said earlier, these transformations transform with respect to the origin. rotations, reflections, scaling and shears all have their reference points at the origin. In order to make their transformation not from the origin, we need to translate the point of reference to the origin (translating the coordinate of the objects together), do the transformation, then translate the coordinate points back again. I don’t know what is the terminology for this, since this is something I figured out myself. If the point of rotation / scaling / shear is (a, b), with M as the transformation matrix, then (x, y) is transformed as follows:
image

In the case of a reflection, as I said earlier, the reflection matrix above applies only for lines passing through the origin, y = mx. Now that we want to find the reflection of an object across the line y = mx + c, we take (0, c) as the point of reference to be subtracted and added in this case. The transformation will become
image

You can try it out and see whether this is true. You will find that translating any point (a, b) will be correct, as long as the line translates such that it passes through the origin.


SIMILARITY TRANSFORMATION

Two square matrices A and B that are related by A = P-1BP where P is a square non-singular matrix are said to be similar. A transformation of the form P-1BP is called a similarity transformation, or conjugation by P. Try recalling what you learnt about similar triangles in Maths T. Similarity transformation simply means that the 2 transformation A and B are similar to each other, just that they probably changed their basis, coordinate or are multiplied by a different factor. I don’t have much information on this, so I wouldn’t elaborate much here (please share with me if you have good information on this, I will add it in here some day). However, if you are asked to find whether 2 matrices A and B are similar, just make use of the formula above, and if the equations are consistent, that it is, if not then otherwise.


Spend some time understanding the shear, the rest are probably quite straightforward.

No comments:

Post a Comment