Example: biology

Chapter 7 Introduction toIntroductionto Matrices

Chapter 7 Introduction toIntroductiontoMatricesMatrices are of fundamental importance in 3D math, where they are primarily used to describe therelationship between two coordinate spaces. They do this by defining a computation to transformvectors from one coordinate space to Matrix A Mathematical DefinitionIn linear algebra, a matrix is a rectangular grid of numbers arranged our earlier definition of vector as a one-dimensional array of numbers, a matrix maylikewise be defined as atwo-dimensional arrayof numbers. (Thetwoin two-dimensional array comes from the fact that there are rows and columns, and it should not be confused with 2D vec-tors or Matrices .)

Chapter 7 Introduction toIntroductionto Matrices Matrices are of fundamental importance in 3D math, where they are primarily used to describe the

Tags:

  Introduction, Chapter, Matrices, Chapter 7 introduction tointroductionto matrices, Tointroductionto

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Chapter 7 Introduction toIntroductionto Matrices

1 Chapter 7 Introduction toIntroductiontoMatricesMatrices are of fundamental importance in 3D math, where they are primarily used to describe therelationship between two coordinate spaces. They do this by defining a computation to transformvectors from one coordinate space to Matrix A Mathematical DefinitionIn linear algebra, a matrix is a rectangular grid of numbers arranged our earlier definition of vector as a one-dimensional array of numbers, a matrix maylikewise be defined as atwo-dimensional arrayof numbers. (Thetwoin two-dimensional array comes from the fact that there are rows and columns, and it should not be confused with 2D vec-tors or Matrices .)

2 A vector is an array of scalars, and a matrix is an array of Matrix Dimensions and NotationJust as we defined the dimension of a vector by counting how many numbers it contained, we willdefine the size of a matrix by counting how many rows and columns it contains. Anr cmatrix(read rbyc ) hasrrows andccolumns. Here is an example of a 4 3 matrix:83 This Chapter introduces the theory and application of Matrices . It is divided into two discusses some of the basic properties and operations of Matrices strictlyfrom a mathematical perspective. (More matrix operations are discussed in Chapter9.)nSection explains how to interpret these properties and operations 4 3 matrix illustrates the standard notation for writing Matrices .

3 We arrange the numbers in agrid, surrounded by square brackets. Note that other authors surround the grid of numbers withparentheses rather than brackets. Other authors use straight vertical lines. We will reserve thisnotation for an entirely separate concept related to Matrices , thedeterminantof a matrix. (We willdiscuss determinants in Section )As we mentioned in Section , we will represent a matrix variable with uppercase letters inboldface, for example:M,A,R. When we wish to refer to the individual elements within a matrix,we use subscript notation, usually with the corresponding lowercase letter in italics. This is shownbelow for a 3 3 matrix:mijdenotes the element inMat rowiand columnj.

4 Matrices use 1-based indices, so the first rowand column are numbered one. For example,m12(read mone two, not mtwelve ) is the ele-ment in the first row, second column. Notice that this is different from the C programminglanguage, which uses 0-based array indices. A matrix does not have a column 0 or row 0. This dif-ference in indexing can cause some confusion if using actual C arrays to define Matrices . (This isone reason we won t use arrays to define Matrices in our code.) Square MatricesMatrices with the same number of rows as columns are calledsquarematrices and are of particularimportance. In this book, we will be interested in 2 2, 3 3, and 4 4 elementsof a square matrix are those elements where the row and column indexare the same.

5 For example, the diagonal elements of the 3 3 matrixMarem11,m22, andm33. Theother elements arenon-diagonalelements. The diagonal elements form thediagonalof thematrix:If all non-diagonal elements in a matrix are zero, then the matrix is adiagonal matrix. Forexample:84 Chapter 7: Introduction to MatricesA special diagonal matrix is theidentity matrix. The identity matrix of dimensionn, denotedIn,isthen nmatrix with 1 s on the diagonal and 0 s elsewhere. For example, the 3 3 identity matrix is:Often, the context will make the dimension of the identity matrix used in a particular situationclear. In these cases, we will omit the subscript and simply refer to the identity matrix identity matrix is special because it is themultiplicative identity elementfor Matrices .

6 (We will learn about matrix multiplication in Section ) The basic idea is that if you multiply amatrix by the identity matrix, you get the original matrix. So, in some ways, the identity matrix isfor Matrices what the number 1 is for Vectors as MatricesMatrices may have any positive number of rows and columns, including one. We have alreadyencountered Matrices with one row or one column: vectors! A vector of dimensionncan beviewed either as a 1 nmatrix or as ann 1 matrix. A 1 nmatrix is known as arow vector, and ann 1 matrix is known as acolumn vector. Row vectors are written horizontally, and column vectorsare written vertically:Until now, we have used the two notations interchangeably.

7 Indeed, geometrically they are identi-cal, and in most cases the distinction is not important. However, for reasons that will soon becomeapparent, when we use vectors with Matrices , we must be very clear about whether our vector is arow or column TranspositionConsider a matrixMwith dimensionsr c. ThetransposeofM(denotedMT) is thec rmatrixwhere the columns are formed from the rows ofM. In other words,MTij=Mji. This flips thematrix diagonally. Equation gives two examples of transposing Matrices : Chapter 7: Introduction to Matrices85 Equation :The 3D identitymatrixEquation :TransposingmatricesFor vectors, transposition turns row vectors into column vectors and vice versa:Transposition notation is often used to write column vectors inline in a paragraph, like this:[1, 2, 3] are two fairly obvious, but significant, observations concerning matrix transposition:n(MT)T=Mfor a matrixMof any dimension.

8 In other words, if we transpose a matrix, and thentranspose it again, we get the original matrix. This rule also applies to any diagonal matrixD, including the identity Multiplying a Matrix with a ScalarA matrixMmay be multiplied with a scalark, resulting in a matrix of the same dimension denote matrix multiplication with a scalar by placing the scalar and the matrix side by side,usually with the scalar on the left. No multiplication symbol is necessary. The multiplication takesplace in the straightforward fashion; each element in the resulting matrixkMis the product ofkand the corresponding element inM. For Multiplying Two MatricesIn certain situations, we can take the product of two Matrices .

9 The rules that govern when matrixmultiplication is allowed, and how the result is computed, may at first seem bizarre. Anr nmatrixAmay be multiplied by ann cmatrixB. The result, denotedAB,isanr c example, assume thatAis a 4 2 matrix, andBis a 2 5 matrix. ThenABis a 4 5 matrix:86 Chapter 7: Introduction to MatricesEquation :Transposingconvertsbetween rowand columnvectorsEquation :Multiplying a4 3 matrixby a scalarIf the number of columns inAdoes not match the number of rows inB, then the multiplicationABis multiplication is computed as follows: let the matrixCbe ther c productABof ther nmatrixAwith then cmatrixB. Then each elementcijis equal to the vector dot product of rowiofAwith columnjofB.

10 More formally:(See Appendix A if you don t know what the symbol that looks like a Z means.)This sounds complicated, but there is a simple pattern. For each elementcijin the result, locaterowiinAand columnjinB. Multiply the corresponding elements of the row and column, andsum the products. (This is equivalent to the dot product of rowiinAwith columnjinB.)cijisequal to this s look at an example. Below we show how to computec24:The element in the second row and fourth column ofCis equal to the dot product of the secondrow ofAwith the fourth column way to help remember the pattern is to writeBaboveC, as shown below. This alignsthe proper row fromAwith a column fromBfor each element in the resultC:For geometric applications, we will be particularly interested in multiplying square Matrices the 2 2 and 3 3 cases are especially important to us.


Related search queries