Processing math: 100%

Lecture 6: Matrices

A matrix is an array of elements that follow certain rules:

A=[163124]

We use square brackets to enclose the array.

A matrix has n rows and m columns, and is said to be of order n×m.

Always mention the rows first. Thus, the above example A is 2×3

Examples

A=[100010001]

is 3×3

B=[110]

is 1×3

C=[1290]

is 4×1

D=[1002010400150001]

is 4×4

A matrix is square if the # of rows == # of columns.

Some common square matrices:

In computer graphics, we most commonly use square 2×2, 3×3, and 4×4 matrices.

Operations

Two matrices are equal if

A=[1234] B=[1xy4]

If A=B, then x=2 and y=3.

Addition and Subtraction

Addition and subtraction of matrices is defined by addition and subtraction of corresponding elements.

We can only add and subtract matrices of the same order.

[213411]+[320010] =[2+31+23+04+01+11+0]=[533421]