Thus for example we add the top left most elements in the two matrices 2 and 5

Thus for example we add the top left most elements in

This preview shows page 52 - 54 out of 227 pages.

As may be seen, addition is carried out by summing corresponding elements within the two matrices. Thus, for example, we add the top left most elements in the two matrices (2 and 5) and place the result (7) in a corresponding position within the matrix which represents the sum. Subtraction is carried out using the same approach: g4674 2 3 1 4 g4675−g4674 5 1 2 4 g4675=g4674 −3 2 −1 0 g4675 However, we cannot perform the following addition and subtraction operations – the matrices are not of the same order: g4674 1 2 g4675+g4674 1 3 4 5 g4675 g4674 1 7 5 2 g4675−g46701 3g4671 Note that the addition of two matrices is commutative (A + B = B + A) whereas subtraction is not commutative (A - B B - A). Multiplication of Matrices The multiplication of two matrices is not quite as simple as the addition and subtraction processes described above. Here, each element within the matrix that represents the result is not obtained by multiplication of corresponding elements. Furthermore in order that two matrices can be multiplied, it is not necessary for them to have the same dimensions: Two matrices can be multiplied if the number of columns in the first matrix equals the number of rows in the second. Thus, for example the following two matrices can be multiplied: g4674 1 2 3 2 5 4 g4675×g3429 1 2 3 3 1 5 2 −1 4 g3433 whereas the following two matrices cannot be multiplied: g4674 2 1 1 6 g4675×g3429 2 3 1 2 6 4 g3433 To illustrate the way in which matrices are multiplied, let us consider a simple example:
Image of page 52
Computer Graphics by Sushma Jaiswal, GGV, Bilaspur (C.G.) Sushma Jaiswal g4674 1 2 3 4 g4675g4674 5 6 7 8 g4675 Notice that it is usual to omit the multiplication sign – the lack of a sign between two matrices is assumed to indicate multiplication. Consider the diagram presented in Figure. In order to obtain element a in the result matrix, we use the first row of the first matrix and the first column of the second matrix (the latter is shown as being arranged as a row and placed above the first matrix). We then multiply the two pairs of elements and add the result. This result provides us with element a in the solution matrix. We then repeat this process using the second row of the first matrix and the first column of the second. Thus we calculate 3 × 5 + 4 × 7 = 43 and this provides element c in the solution matrix. Having operated on both rows of the first matrix using the first column of the second, we now repeat the process – but this time we make use of the second column in the second matrix. In Figure below, we show the generation of element b in the solution matrix. Element d is obtained by using the second column of the second matrix and the second row of the first. When first encountered, the multiplication process can seem complicated and perhaps confusing. However, the key is to remember that we take each of the columns of the second matrix and use these to operate in turn on each row of the first. Returning to the above example, the Figure To multiply matrices we bring together columns of the second matrix with rows of the first. Here, we illustrate the operation performed using the top row of the first matrix with the first column of the second. This provides element a in the solution matrix.
Image of page 53
Image of page 54

You've reached the end of your free preview.

Want to read all 227 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture