Tuesday, July 19, 2011

11.2 – Matrix Representations

Knowing all the different types of transformation, we shall now get to do the algebra of transformations. Let’s begin with a simple example:

Find and describe the image of the triangle ΔABC where A(1, 0), B(2, 0) and C(2, 3) under the transformation matrix
image.

image
Plotting the new coordinates OA’, OB’ and OC’, we find that the transformation is a reflection in the x-axis (or reflection in Ox).


Singular transformation in 2 dimensions maps all shapes are transformed into either a point or a line, and a line is transformed into a single point. In other words, the area of the object is destroyed. Consider the matrices below:
image

The first one maps all shapes to the line y = x. The second matrix maps all points to the x-axis, while the last one maps everything to the origin. You will know that a matrix M is a singular matrix when | M | = 0. There is a way to tell whether a matrix maps to a line or to a point. Consider a singular matrix
image

If the column vector (a, b) = (c, d), then the matrix maps all shapes to a point. If the column vector (a, b) ≠ (c, d) but (a, b) // (c, d), then the matrix maps all shapes to a line.


AREA SCALE-FACTOR AND THE DETERMINANT

Throughout our discussion on transformations, we haven’t discussed on how the transformation affects the area of an object. We want to know whether a certain transformation makes a certain object enlarged or diminished. It turns out that the determinant of the matrix of transformation tells us information on how the area would be in the end. With the matrix of transformation M, We see that

Area of object × det (M)  = Area of image

In the case when | M | = 0, the transformation maps lines or shapes to a point, and the area is destroyed, in which agrees with the part earlier on.


Invariant points are points which map to themselves after the transformation. This means thatimage

If you might have noticed, this reminds you on the chapter about eigenvalues and eigenvectors, in which this situation, the eigenvalue is one. To find the invariant points for the transformation M, for example
image
You substitute it into the equation above, then you get
x = x
y = –y

So this tells us that the invariant points of this transformation are any points (x, 0), or simply just the points on the x-axis. Verify yourself to see whether this is true.

An invariant line, maps a line to the same line, but not necessarily mapping all the points to the same points. In our study, all invariant lines must pass through the origin, and even if there were invariant lines that do not pass through the origin, it must be parallel (has the same gradient) to another invariant line which passes through the origin. To find the invariant lines under a certain transformation, we make use of the parametric form of the line, x = t, y = at. We substitute the variable t into x and y and we have
image

or to make life easier, we rather put
image

Note that the variable x maps to another variable X, but not to itself. I’ll show you an example:

Find the invariant lines of the transformation
image

image
So we have two equations
mx = X
x(5 – 4m) = mX

Dividing both the equations, we get a quadratic equation
m2 + 4m – 5 = 0, m = 1, –5
We have the lines y = x, y = –5x.

You might want to test whether the lines y = x + c or y = –5x + c are invariant too. Substitute it back into the equation,
For m = 1,
x + c = X
5x – 4x – 4c = X + c
We get c = 0, ∴ the lines y = x + c are not invariant.

For m = –5,
-5x + c = X
25x = –5X + 5c
Since both are just 1 equation, c is dependent of x and X, and thus y = –5x + c are invariant lines.

∴ The invariant lines are y = x, y = –5x + c, where c is an arbitrary constant.


TRANSFORMING LINES

Knowing how to transform points, we shall now learn how to transform lines. As in the part on invariant lines, we substitute the parametric equation of x and y, then we solve the equation in terms of X & Y, as the equation below
image

Example,
Find the image of the line y = 2 – 2x under the transformation
image

We first substitute the line into the transformation,
image

2x + 2 – 2x = X = 2
4x + 4 – 4x = Y = 4

∴ The line transform into the point (x, y) = (2, 4).

Notice that in this case, the line is transformed into a point. In other cases if it transforms into another line, remember to find an equation that relates X with Y. You should be aware that this is the very same method you will do if you were to find the transformation of circles, parabolas, hyperbolas, ellipses or other curves. Make use of their parametric equations and substitute them into the equation. Recall the parametric forms of these curves.


INVERSE TRANSFORMATION

I think I don’t need to elaborate too much on this. An inverse transformation helps us to find the object if the image is given. You find the inverse of the matrix of transformation, and the equation will become
image

From here you should recall that a singular transformation has no inverse. In other words, you can’t find a matrix that transform a single point to 4 other points, or transform a line into a pentagon.


ADDITION, SUBTRACTION, SCALAR MULTIPLICATION, COMPOSITION

The addition and the subtraction of transformations M and N,

M(x) + N(x) = (M + N) (x)
M(x) – N(x) = (M – N) (x)

Although is defined so, has no geometrical meaning. For example, I add a matrix of rotation of 45 degrees with a matrix of reflection along the line y = x, gives you some awkward transformation, which doesn’t really have a relation to both. But the scalar multiplication of a matrix does mean something,

(cM) (x) = c(M) (x)

as it has the effect of scaling. Both these operations, I assume you already know how to do so, as this is covered in the chapter Matrices in Maths T. We are more interested in the composition of transformations. Given two transformation M and N, If the an object undergoes transformation M, then transformation N, it can be written as
image

Or we could also write it as (N ∘ M) (x) = x.

I think you probably remembered in form 4 that the transformation NM means “transform M first, then transform N”. This is quite straightforward, I think. In exams, you will be asked to find the matrix of the combined transformation of 2 or more transformations. If not, you will be given the points of the object and image, with half of the transformation, then ask you to find the other missing transformation, as well as describing it. Just make use of what you learnt about Matrices.



I think this chapter shouldn’t be a problem for you. It is those weird definition questions that you might probably don’t know how to solve. A scoring chapter, yet again.

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.