Matrix Algebra: Definitions and Systems of Linear Equations, Study notes of Algebra

This appendix provides a practical overview of matrix definitions, systems of linear equations, and basic principles of matrix algebra. It covers matrix elements, dimensions, transpose, determinants, and matrix multiplication. The appendix also discusses the importance of matrices in physically based animation and encourages further study of Linear Algebra.

Typology: Study notes

2021/2022

Uploaded on 08/05/2022

aichlinn
aichlinn 🇮🇪

4.4

(46)

1.9K documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
APPENDIX B
Matrix Algebra
CONTENTS
B.1 Matrix definitions .............................................. 329
B.2 Systems of linear equations ................................... 332
Although it is the intent of this book to be reasonably self contained, the subject of matrices
and matrix algebra is a complex topic, subsumed under the field of Linear Algebra. What
we are attempting in this section is to give a simple, and practical overview of some of
the basic principles of matrix algebra that will be essential to the introductory study of
physically based animation. The student who wishes to go on in computer graphics is
strongly encouraged to make a thorough study of Linear Algebra, since it furnishes many of
the key mathematical tools necessary to understand advanced texts and research papers
in the field.
B.1 MATRIX DEFINITIONS
A single real number is called a scalar. If we have a column of scalars, we have a vector. A
set of vectors, each with the same number of entries and arranged in a rectangular array
is called a matrix.1This construction can be continued to higher dimensions, collecting a
set of matrices together to form a tensor. Abstractly, all of these objects are considered to
be tensors of various orders: a scalar is an order 0 tensor, a vector an order 1 tensor, and
a matrix an order 2 tensor.
The individual scalars making up a matrix are called its elements. An arrangement of n
horizontal rows, and mvertical columns is called an n×mmatrix. An example would be
1Please note the construction of the plural: one matrix, two matrices.
329
pf3
pf4
pf5

Partial preview of the text

Download Matrix Algebra: Definitions and Systems of Linear Equations and more Study notes Algebra in PDF only on Docsity!

A P P E N D I X B

Matrix Algebra

CONTENTS

B.1 Matrix definitions.............................................. 329

B.2 Systems of linear equations................................... 332

Although it is the intent of this book to be reasonably self contained, the subject of matrices and matrix algebra is a complex topic, subsumed under the field of Linear Algebra. What we are attempting in this section is to give a simple, and practical overview of some of the basic principles of matrix algebra that will be essential to the introductory study of physically based animation. The student who wishes to go on in computer graphics is strongly encouraged to make a thorough study of Linear Algebra, since it furnishes many of the key mathematical tools necessary to understand advanced texts and research papers in the field.

B.1 MATRIX DEFINITIONS

A single real number is called a scalar. If we have a column of scalars, we have a vector. A set of vectors, each with the same number of entries and arranged in a rectangular array is called a matrix. 1 This construction can be continued to higher dimensions, collecting a set of matrices together to form a tensor. Abstractly, all of these objects are considered to be tensors of various orders: a scalar is an order 0 tensor, a vector an order 1 tensor, and a matrix an order 2 tensor.

The individual scalars making up a matrix are called its elements. An arrangement of n horizontal rows, and m vertical columns is called an n × m matrix. An example would be

(^1) Please note the construction of the plural: one matrix, two matrices.

330  Foundations of Physically Based Modeling and Animation

the matrix

M =

a b c d e f g h i

M’s elements are the scalars a through i, whose values are real numbers. M is a 3 × 3 matrix, consisting of the three rows: [ a b c

]
[

d e f

]
[

g h i

]

and the three columns: (^)    

a d g

b e h

c f i

Because M has the same number of rows as columns, it is called a square matrix. Since the columns of a matrix, taken individually, are really vectors, they are called column vectors. Similarly, the rows of a matrix, taken individually, are called row vectors. The sequence of elements of a square matrix forming the diagonal from the upper left to the lower right corner is called the diagonal of the matrix. All other elements of the matrix are called the

off diagonal elements. Our example matrix M has the diagonal

[

a e i

]

The transpose of a matrix is constructed by interchanging its rows and columns. Thus, the transpose of an m × n matrix will be an n × m matrix. Returning to our example, the transpose of matrix M is

MT^ =

a d g b e h c f i

Note, that the row vectors of the original matrix are now the column vectors of the transpose. Likewise, the column vectors are now the row vectors of the transpose.

We can unify the notions of vector and matrix if we consider a column vector of n elements to be an n × 1 matrix. Similarly, a row vector of n elements can be considered to be a 1 × n matrix. If we think of a vector in this way, we can take its transpose, turning a column

vector into a row vector. If v =

[

vx vy

]

, then v T^ =

[

vx vy

]

The determinant of a matrix is a scalar value, written |M|. The determinant is defined only for square matrices. For small matrices it is defined as follows:

2 × 2 : M =
[

a b c d

]

, |M| = ad − bc,

3 × 3 : M =

a b c d e f g h i

 ,^ |M|^ =^ aei^ +^ b f g^ +^ cdh^ −^ (ceg^ +^ bdi^ +^ a f h).

For larger matrices, the definition of the determinant becomes more complex, and the reader is referred to a more advanced text.

Matrix multiplication is defined between matrices of compatible dimensions. An a × b

332  Foundations of Physically Based Modeling and Animation

For a 3 × 3 matrix, the inverse is given by

M =

a b c d e f g h i

M−^1 =
|M|

ei − f h ch − bi b f − ce f g − di ai − cg cd − a f dh − eg bg − ah ae − bd

For larger matrices, the reader is again referred to a more advanced text.

A word of caution is necessary with regard to matrix inverse. First, a matrix that is non- square has no inverse. Second, as we can see from the equations above, computing the inverse of a matrix involves dividing by the determinant of the matrix. If this determinant is 0, the matrix inverse is indeterminate.

B.2 SYSTEMS OF LINEAR EQUATIONS

Matrices arose in an attempt to develop a compact algebra to describe the solution of sets of simultaneous linear equations. Suppose we have two variables x and y, and we want to find the solutions for x and y satisfying the equations

ax + by = u cx + dy = v

One way to solve these equations would be to begin by solving the first equation for x = (u − by)/a, and then substitute this expression for x into the second equation, leaving a single equation with only the variable y, which has the solution y = (av − cu)/(ad − cb). Inserting the solution for y into the equation for x gives us x = (du − bv)/(ad − cb).

In Linear Algebra, the original pair of equations would be written in the form of a matrix and two vectors: (^) [ a b c d

] [

x y

]
[

u v

]

or more abstractly M x = u ,

where M, x , and u have the obvious definitions from the original expanded form of the equation. Notationally, we have gone from the more cumbersome original pair of linear equations to a more compact algebraic expression.

We now have the machinery to solve a linear system of equations written in matrix form:

M x = u , M−^1 M x = M−^1 u , I x = M−^1 u , x = M−^1 u.

Matrix Algebra  333

Applying this logic to our two equation example from the start of this section, we have

x = M−^1 u =

ad − bc

[

d −b −c a

] [

u v

]
[

(du − bv)/(ad − bc) (av − cu)/(ad − bc)

]
[

x y

]

which matches the solutions for x and y obtained by the original substitution process.

Note that there are cases where a system of linear equations will not yield a unique solution. These correspond exactly with cases where the determinant of the system’s matrix is 0. For example, suppose we had the following two word-problems regarding a collection of apples and bananas. In both problems, let a be the number of apples, and b be the number of bananas.

  1. There are twice as many apples as bananas. The total number of pieces of fruit is

a − 2 b = 0 , a + b = 30

M x = u , with M =

[
]

, x =

[

a b

]

, u =

[
]

x = M−^1 u , with |M| = 1 / 3 , M−^1 =

[
]

x =

[
]
  1. There are twice as many apples as bananas. There are half as many bananas as apples.

a − 2 b = 0 , − 1 / 2 a + b = 0

M x = u , with M =

[
]

, x =

[

a b

]

, u =

[
]

x = M−^1 u , with |M| = 0 , so M−^1 is indeterminate

One can easily see why there is no unique solution to the second problem. It is because the second condition, “There are half as many bananas as apples,” adds no new information to the problem. We already knew that there are twice as many apples as bananas. The consequence, in the formation of matrix M, is that the second row of the matrix is just a scalar multiple (-1/2) of the first row.

In general, a matrix that has a row that is a linear combination (i.e. a weighted sum) of one or more of the other rows will have a determinant of 0, and thus no inverse. Such a matrix is called degenerate, and indicates that the original problem does not have enough information to yield a unique solution.