Matrices are rectangular grids of numbers arranged in rows and columns. Applications of matrices are found in many areas of mathematics and science. Areas of application include: 2D and 3D computer graphics, linear programming, Markov chains in probability theory, finite state automata theory, graph theory, network theory, multiple dimension vector spaces, economic modeling, solving systems of linear equations, calculus, and statistics.
Objects or shapes are drawn and moved in 2D or 3D space on a computer screen by multiplying matrices. Numerically intensive matrix computations are offloaded to video cards that are optimized to carry out millions of matrix multiplications per second. Generally speaking, computer animation is achieved as follows by repeating steps 1, 2, and 3 below.
Step 1) Use the coordinates of the current geometric object or shape to calculate the coordinates of a new geometric object. The coordinates of a new object are calculated by multiplying the coordinates of the current object by a matrix or series of matrices so that the resulting product gives us the coordinates of an object that is to be translated, rotated about a point, reflected over a line or plane, horizontally stretched/shrunk, or vertically stretched/shrunk.
Step 2) Erase the object from the screen.
Step 3) Use the coordinates of the new object to draw the object on the screen and then make the coordinates of the current object equal to the coordinates of the new object.
A previous post discussed the mathematical concepts of inverse of a relation and inverse of a function where the matching rule of the relation was an x-y variable equation. Like many concepts in mathematics, the concept of the inverse of a relation and the inverse of a matrix are connected. The purpose of this post is to show how the concept of the inverse of a geometric transformation matrix dovetails with the general concept of the inverse of a relation. Because of time and space considerations, it’s not possible to provide a review of matrix algebra and 2D geometric transformation matrices in this post, but you can find a concise summary of these topics by downloading the free handouts Introduction to Matrices and Geometric Matrix Transformations (student version) or by visiting mathteachersresource.com/instruction-content. The Matrix Geometric Transformations (student version) handout contains a list of student exercises which are designed to drive home key concepts. The teacher version of this handout provides detailed solutions of the exercises.
I will start the discussion by describing three basic 2D geometric transformation matrices and the structure of a preimage matrix [P] which contains the vertices of the object or shape to be transformed. Notice that all 2D transformation matrices have three horizontal rows and three vertical columns. Preimage matrices have three horizontal rows and n vertical columns; one column for each of the n vertices of the geometric object. In passing, 3D geometric transformation matrices have four rows and four columns.
I will now show you how to use transformation matrices to rotate an object 1200 counterclockwise and 1200 clockwise about (0, 0). Notice that the transformation matrices [T1] and [T2] must be inverses of each other because a clockwise rotation of 1200 reverses a counterclockwise 1200 rotation. The vertices of the green colored preimage polygon are contained in matrix [P]. For the red polygon, the matrix of vertices [P’] = [T1][P]. For the blue polygon, the matrix of vertices [P’] = [T2][P]. Matrix elements are rounded to three decimal places.
Now let’s take a look to see how a translation matrix can be used to slide a figure 7 units to the left and 5 units up. Notice that the transformation matrices [T1] and [T2] must be inverses of each other because sliding a figure in the opposite direction reverses a slide operation. The green colored polygon is the preimage object. For the red polygon, the matrix of vertices [P’] = [T1][P].
I will conclude this post my showing you how basic geometric transformation matrices can be chained together to get a desired geometric transformation of an object. In this example, the green colored polygon is rotated 1800 about the point (1, 3). Therefore the polygon is first slid 1 unit to the left and 3 units down. Next, the translation image is rotated 1800 about the origin. The final step in the transformation is to reverse the effects of the initial translation by multiplying by [T2]. Because of the nature of matrix multiplication, matrix multiplication in an expression must be performed in a specific order; usually right to left. When doing algebraic manipulations of matrix expressions, it’s easy to forget that matrix multiplication is NOT communitive. In fact, the matrix expression [P][T1] is undefined, but [T1][P] is perfectly legal.
Comments Regarding the Inverse of a Matrix:
- Only square matrices (equal number of rows and columns) can have an inverse.
- Not all square matrices have an inverse.
- Geometric transformation matrices have an inverse because all affine transformations can be reversed.
- If the functions f(x) and g(x) are inverses of each other, then f(g(x)) = g(f(x)) = x, the identity function.
- If the matrices [A] and [B] are inverses of each other, then [A][B] = [B][A] = [I], the identity matrix.
- Before digital computers, finding the inverse of a large matrix was a daunting task.
- Students can use a graphing calculator to find the inverse of a matrix if the matrix is not too large.
- The inverse of a basic affine geometric transformation matrix can found by just inspecting the matrix.