Matrices Prequel: Linear Transformation
Transformation } Function
- Vector Input -> Vector output
- its raining so hard
- i love 3 blue 1 brown <3 go watch the video Linear }
background
- used to represent linear transformations (like in computer animations)
- it is a rectangular (though often square) array of mathematical objects.
- if it has m rows and n columns, it is called an m x n matrix
- entries in the matrix can be indexed using subscripts for the row and column - is in row 1, column 3 = 0
matrix equality
- if and only if they have same number of rows and columns, and all corresponding entries are equal.
addition and multiplication of matrices
- notes not needed (intuitive and straightforward)
11C: matrix multiplication
multiplying two matrices
- matrices can be multiplied even if they do not have same dimensions.
- work through the rows of the first matrix, and the column of the second.
- form the scalar product for each row and column of the first and second matrix.
- properties of matrix multiplication creates certain rules within matrices.
- two matrices can be multiplied together provided the number of columns in the first matrix equals the number of rows in the second matrix.
- suppose matrix A has dimension m x n, and matrix B has dimensions p x q.
- the product can only be formed if .
- in this case AB will have dimension m x q.
- the product can only be formed if .
- in this case BA will have dimension p x n.z
- in the product AB we say that B is premultiplied by A or A is postmultiplied by B.
- the product can only be formed if .
zero matrix
- 0 is called the additive identity of the real numbers
- consider the matrix:
- then:
- for a given matrix size mxn, the matrix
- the 0 matrix leaves the other matrix unchanged.
identity matrix
- in normal multiplication, is always x
- in matrices, the matrix X multiplied by the identity matrix is always X
- consider the matrix:
- then the identity matrix (1 0 \ 0 1) and multiplied
consider non-square matrices
- consider the matrix:
- to multiply by a matrix and attain the same matrix: ? would be:
- then what about the case where:
- then:
- the notation of the identity matrix is with x being the dimensions (only 1 dimension is needed because the identity matrix is always square)
a word of warning
- the matrices A x B = C in which C is a 0 matrix, and A is not a matrix, B is NOT ALWAYS a 0 matrix.
- furthermore, in normal arithmetic, 3a = 3b, such a = b - therefore in matrices, AB = CB, therefore A = C - THIS IS INCORRECT - consider - in this case AB = CB, B!=0, but A != C
- same case for identity matrices as well. you CANNOT assume an unknown matrix is the identity matrix.
matrix division
- there is no concept of matrix division but theres something similar (?)
- consider multiplying 4 by 3
- to get back to 4 from 12, you could divide 12 by 3
- alternatively you could multiply 12 by
- this is because
- there is no division operation in matrix arithmetic, but we can use the second method to ‘undo’ multiplication by a matrix:
- to get B from C, multiply (on the left) by a matrix such that A^{-1}AB=A^{-1}C$$$$IB=A^{-1}C the matrix is called the inverse matrix.
how to find the inverse matrix
- given a matrix A, how do you find the inverse matrix
- messy process: - case: - let: - we need to find the matrix - preferably with and given in terms of and . - we know that - blah blah blah rearrange expression you get (for the 2x2 case) - and blah blah for x, y, z
- therefore: for
(ad-bc) is the determinant of A, written det A or
- it is possible that
- a matrix with an inverse is invertible.
- a matrix with no inverse is singular (or just non-invertible lol)
Recap
- multiplicative identity matrix
- always a square, and when it is multiplied to a given matrix, the matrix remains unchanged.
- the inverse of a given matrix has the property of multiplying the given matrix to gain the identity matrix.
- to find the inverse of a 2x2 matrix
- for
- there may be a case where an inverse does not exist, which is where
solving a system of a linear equation (using matrices)
- x-y = 7
- 2x + 3y = 4
- you can extrapolate both systems into a linear equation (using coefficients)
ie coefficient matrix A x variable matrix = constant matrix the aim is to convert to the form: where and are the solutions
method
pre-multiply both sides by
matrix arithmetic
- recall that simulations solutions in 2 variables can have (lines intercept in one point)
- no solutions, or (lines parallel
- infinitely many solutions (lines coincident))
- if a coefficient matrix is non-invertible, it could either have no solutions, or infinitely many solutions.
Matrices Transformation
- Shear: not a part of the actual syllabus ( i think ? ), but we are learning anyways.
- Transformation in the 2D plane r ways of systematically changing points P = (x, y) to points P’ = (x’, y’) (e.g. (2, 5) reflected through the y-axis is (-2, 5))
- you can describe these transformation by multiplying it by a 2x2 matrix.
- First P = (x, y) is written as a column matrix
basic idea
- start with (2, 3), to transform with :
- so (2, 3) gets transformed to (-4, 9)
- translation is not a linear transformation, because it does not satisfy the linear transformation’s definition of “the origin has to stay where it is”, where if you translate the entire plane, the origin will move as well.
- reflection is only a linear transformation if it is on the line of the origin, otherwise the position of the origin is changed.
how to find what kind of transformation a transformation matrix is (top secret pro tip 99.95% of matrix solvers dont know about)
- say you have the transformation matrix , take the arbitrary values of x and y and apply the transformation on it.
Transformation Matrices: Ultimate Guide
- Take the identity matrix
- if you change in , if , horizontal dilation by , if , reflection through y-axis combined with a horizontal dilation by a factor of
- if you change in , a horizontal shear occurs, where the transformation is dependent on how far away the point is from the x-axis.
- if you change in , a vertical shear occurs, where the transformation is dependent on how far away the point is from the y-axis.
- if you change in , if , vertical dilation by , if , reflection through x-axis combined with a horizontal dilation by a factor of
Rotation
- observe that for a given matrix , the following is true:
- if you know where the two points and lands, you can identify the rotation. in a 90 degree rotation:
- lands on
- lands on
- therefore the transformation matrix maps out to be:
HOW TO: Matrices for Arbitrary Reflections and Rotations (WTF!!!!)
general rotation
- rotate a unit by , the transformation matrix would be .
- interesting. but what is the pattern here?
- let’s go back to what we learnt prior, and define the transformation matrix as transformations of and
- the point would be transformed to
- the point would be transformed to
- looks better with a graph - no wifi rn so just google “a general rotation about the origin graph for matrices” maybe comes up with a result lol xDDD ^_^ THEREFORE IT WOULD MAP TO where is an anti-clockwise rotation about the origin.
- THIS IS IN THE FORMULA BOOKLET! - NO NEED TO MEMORISE IT 8)
general reflection
- once again, we need to find where the points A (1, 0) and B (0, 1) ends up after a reflection.
- search up “general reflection in a line that passes through the origin graph proof matrices” for a graph.
- the angle made with the x axis is twice the angle of the line of reflection (looks more obvious when you look at it), therefore (1, 0) maps to
- C (0, 1) maps to (wow!) therefore the matrix for reflection is: where the reflection is in the line
- once again, this is in the formula sheet, no need to memorise it.
transformation matrices: combining transformation
- consider (dilation by 3) and (rotation anti-clockwise around origin)
- how do you find the single transformation matrices that follows the transformation of A proceeded by B?
- matrix multiplication.
- say you have the arbitrary values , and it is transformed by A, then we get
- then multiplying by B changes to which equals
Warning A -> B IS BA
NOTE THAT MULTIPLICATION IS IN REVERSE ORDER
transformations of lines
- all points on the line are transformed by the matrix . Find the equation of the image line.
- let be a point on the line
- then
- the image of is , where and .
- but ,