Matrices :
Matrices Basic concepts
Solving simultaneous equations
Eigenvectors and eigenvalues
Transformations. Instructor: Dr Pradeep Malakar What is a Matrix? :
What is a Matrix? A matrix is a set of elements, organized into rows and columns (a rectangular array of scalars)
An mxn matrix has m rows and n columns.
A square matrix of order n, is an nxn matrix. 4x3 matrix Definitions :
Sometimes we wish to refer to individual elements in a matrix.
E.g. the number in the third row, second column. We use the notation aij (or bij etc.) to indicate this.
i refers to the row j refers to the column
Example
a13 = 3
a21 = 7
What is b21? Definitions The Zero Matrix :
The Zero Matrix The zero matrix is defined to be 0 = (0), whose dimensions depend on the context. For example, Matrix Equality :
Matrix Equality Two matrices A = (aij) and B = (bij) are equal if aij = bij for all i and j. For example, Matrix Addition and Subtraction :
Addition (matrix of same size) - the sum of two m x n matrices A = (aij) and B = (bij) is defined to be A + B = (aij + bij).
Commutative: A+B=B+A
Associative: (A+B)+C=A+(B+C)
Subtraction consider as the addition of a negative matrix - the difference of two m x n matrices A = (aij) and B = (bij) is defined to be A - B = (aij - bij). Matrix Addition and Subtraction Matrix – Scalar Multiplication :
Matrix – Scalar Multiplication The product of a matrix A = (aij) and a constant k is defined to be kA = (kaij). For example, Slide 8:
(a) (b) (c) Examples: Slide 9:
Then (1) A+B = B + A (2) A + ( B + C ) = ( A + B ) + C (3) ( cd ) A = c ( dA ) (4) 1A = A (5) c( A+B ) = cA + cB (6) ( c+d ) A = cA + dA Properties of matrix addition and scalar multiplication: Slide 10:
Matrix multiplication: where Notes: (1) A+B = B+A, (2) Visualising multiplying :
Visualising multiplying A matrix = ( m x n )
B matrix = ( k x l )
A x B is only viable if
k = n
width of A = height of B
Result Matrix = ( m x l ) m x n k x l m x l Slide 12:
Find AB Multiplication :
Multiplication Is AB = BA?
multiplication is NOT commutative! Slide 14:
(1) Ａ(BC) = (AB ) C (2) Ａ(B+C) = AB + AC (3) (A+B)C = AC + BC (4) c (AB) = (cA) B = A (cB) Properties of matrix multiplication: Summary of Basic Operations :
Summary of Basic Operations Addition, Subtraction, Multiplication add elements subtract elements Multiply each row by each column Transpose :
Transpose The transpose of A = (aij) is AT = (aji).
For example, Slide 17:
A square matrix A is symmetric if A = AT A square matrix A is skew-symmetric if AT = –A Symmetric matrices: Slide 18:
is a skew-symmetric, find a, b, c? Identity Matrix :
Identity Matrix The identity matrix I is an n x n matrix given by
For any square matrix A, it follows that AI = IA = A.
The dimensions of I depend on the context. For example, Determinant of a Matrix :
Determinant of a Matrix Used for inversion - if |A| = det(A) = 0, then A has no inverse (see next)
Find det(B) if Slide 21:
Determinant of a Matrix Slide 22:
Determinant of a Matrix Slide 23:
Determinant of a Matrix Inverse of a Matrix :
Inverse of a Matrix Finding the inverse of a larger matrix is more complicated, and we will need to use other methods – you will only be required to find the inverse of a 2 x 2 matrix for the purposes of this course. Slide 25:
2 - 25 Matrix form of a system of linear equations: Solving simultaneous equations :
Solving simultaneous equations Matrices can be used to solve simultaneous equations. For example, solve the simultaneous equations
First express the equations in matrix form:
to find X, premultiply both sides by the inverse of A: Slide 28:
Solve the following equations using matrix methods Slide 29:
We are next going to explore matrix multiplication, where the equation is
y = Ax 2D Transformations :
2D Transformations x y x y x y Transformations :
Transformations 2 × 2 matrices can be used to describe transformations in a 2-d plane.
Before we look at this we are going to look at particular transformations in the 2D plane.
A transformation is a rule which moves points about on a plane.
Every transformation can be described as a multiple of x plus a multiple of y.
y = Ax Transformations :
Transformations Lets look at a point A(-2,3) and map it to the co-ordinate (2x+3y,3x-y)
This gives us the co-ordinate
(2×-2 + 3×3, 3×-2–3)
=(5,-9)
Where would the co-ordinate
(2,1) map to?
What is the transformation matrix,
A (-2,3) (5,-9) (2,1) (7,5) Transformations :
x 2x + 3y Transformations y 3x – y We could write this as:
x’ = 2x + 3y
y’ = 3x - y Transformations :
Transformations Writing it in matrix form is useful as we can now multiply the object by our transformation matrix. Transformations :
Transformations Transform the rectangle below by the following matrix. Can you describe the transformation in words? 2D Transformation :
2D Transformation Given a 2D object, transformation is to change the object’s
Position (translation)
Size (scaling)
Orientation (rotation)
Shapes (shear)
Apply a sequence of matrix multiplication to the object vertices Translation :
Translation A translation moves all points in an object along the same straight-line path to new positions.
The path is represented by a vector, called the translation or shift vector.
We can write the components:
p'x = px + tx
p'y = py + ty
or in matrix form:
P' = P + T * Remember the vector equation of a straight line,
e.g. r = (2i+3j) + l(1i+3j) Rotation :
Rotation A rotation repositions all points in an object along a circular path in the plane centered at the pivot point.
First, we’ll assume the pivot is at the origin.
We can write the components:
p'x = px cos – py sin
p'y = px sin + py cos
or in matrix form:
P' = R • P More rotation :
More rotation Another convention, we’ll take to be counterclockwise, as in our example.
R, the rotation matrix, looks like: Scaling :
Scaling Scaling alters the size of an object. Scales are about the the origin.
Scale factors between 0 and 1 shrink objects. Scale factors greater than 1 enlarge objects.
We can write the components:
p'x = sx • px
p'y = sy • py
or in matrix form:
P' = S • P
The scale factors need not be the same in each direction. More scaling :
More scaling We write a scale matrix as:
Scaling also translates objects; away from the origin if the scale factor is greater than 1, or towards the origin if the scale factor is less than 1.
What does scaling by 1 do?
What is that matrix called?
What does scaling by a negative value do? Other transformations :
Other transformations Reflection:
x-axis y-axis Other transformations :
Other transformations Reflection:
origin line x=y Order of operations :
Order of operations So, it does matter. Let’s look at an example: Slide 45:
A linear transformation T has matrix
(a) Find the image of the point (2,3) under T
(b) Find the coordinates of the point having an image of (7,2) under T (1,5) (3,-1) Slide 46:
Find the 2 x 2 matrix that will transform the point (1,2) to (3,3) and the point (-1,1) to (-3,3). Slide 47:
Find the equations of any lines that pass through the origin and map onto themselves under the transformation whose matrix is The above is a representation of a homogenous linear equation. A non trivial solution exist by setting the determinant of matrix A
det(A)=0 These are invariant lines Eigenvalues and Eigenvectors :
Eigenvalues and Eigenvectors Under any linear transformation, the origin is an invariant point (a translation is NOT a linear transformation)
If point A(x,y) lies on an invariant line, then it’s image A’(x’,y’) must also lie on the line
For the transformation matrix T, we know that eigenvalue eigenvector Eigenvalues and Eigenvectors :
Eigenvalues and Eigenvectors If values of x, y and λ can be found such that
Then
is an eigenvector for the transformation
is the associated eigenvalue
And the point (x,y) lies on an invariant line passing through the origin
If then
And the invariant line consists of invariant points Slide 50:
Show that the transformation with matrix maps all
points on the line onto a single point and
find the position vector of this point Slide 51:
Ex 1: (Verifying eigenvalues and eigenvectors)