WEBVTT 1 00:00:05.706 --> 00:00:09.860 Game Basic Episode Basic Math that Upholds the Game 4 (Matrix, Inverse matrix) 2 00:00:09.860 --> 00:00:12.078 GCC Academy 3 00:00:29.444 --> 00:00:30.894 Hello, everyone 4 00:00:30.894 --> 00:00:32.700 This is Lee Deukwoo of Game Math 5 00:00:32.700 --> 00:00:35.350 This time, I prepared a lecture about 6 00:00:35.350 --> 00:00:38.747 matrix and inverse matrix, which serve an important role 7 00:00:38.747 --> 00:00:42.180 in the computer graphics process that we will use 8 00:00:42.180 --> 00:00:45.580 Matrix is divided into 4 types 9 00:00:45.580 --> 00:00:47.930 First, we'll learn about what matrix is 10 00:00:47.930 --> 00:00:49.979 and we'll learn about the method 11 00:00:49.979 --> 00:00:52.229 of how it is calculated 12 00:00:52.229 --> 00:00:54.355 Second, using the matrix 13 00:00:54.355 --> 00:00:57.455 we'll learn about how to calculate and apply 14 00:00:57.455 --> 00:01:00.200 the linear transformation we learned before 15 00:01:00.200 --> 00:01:02.400 Third, when the linear transformation process 16 00:01:02.400 --> 00:01:05.339 is connected to matrix 17 00:01:05.339 --> 00:01:07.980 we'll learn about how it can be visualized 18 00:01:07.980 --> 00:01:11.373 Once you learn about this principle 19 00:01:11.373 --> 00:01:13.623 you'll be able to perform the wanted linear transformation 20 00:01:13.623 --> 00:01:17.379 by designing it with a matrix 21 00:01:17.379 --> 00:01:20.739 Finally, we'll learn about the product of matrix 22 00:01:20.739 --> 00:01:22.489 Through the multiplication of matrices 23 00:01:22.489 --> 00:01:26.109 we'll learn about why they allow us to calculate quickly 24 00:01:26.109 --> 00:01:28.059 We'll learn about 25 00:01:28.059 --> 00:01:30.521 the basic mechanism 26 00:01:30.521 --> 00:01:32.471 For inverse matrix 27 00:01:32.471 --> 00:01:34.961 I'll explain in two parts 28 00:01:34.961 --> 00:01:38.059 First, I'll explain about the concept of inverse matrix 29 00:01:38.059 --> 00:01:40.809 And second, I'll talk about 30 00:01:40.809 --> 00:01:41.900 the calculation method of inverse matrix 31 00:01:42.149 --> 00:01:45.792 Matrix 32 00:01:46.211 --> 00:01:49.221 We'll first learn about the matrix 33 00:01:49.221 --> 00:01:52.671 To define a matrix in simple terms 34 00:01:52.671 --> 00:01:54.900 it's simply a rectangular frame 35 00:01:54.900 --> 00:01:58.900 with numbers arranged in rows and columns 36 00:01:58.900 --> 00:02:01.091 It's very simple, right? 37 00:02:01.091 --> 00:02:04.741 Rather than the matrix itself having some meaning 38 00:02:04.741 --> 00:02:09.091 the numbers are arranged inside the rectangular frame 39 00:02:09.091 --> 00:02:12.702 And it's a tool that helps us 40 00:02:12.702 --> 00:02:15.259 calculate something conveniently 41 00:02:15.259 --> 00:02:19.159 I'll explain about this again later but 42 00:02:19.159 --> 00:02:22.139 the linear transformation that we mentioned earlier 43 00:02:22.139 --> 00:02:26.092 can be performed in a very easy, fast, and simple way 44 00:02:26.092 --> 00:02:28.899 through this calculating tool 45 00:02:28.899 --> 00:02:31.709 So when we assign the matrix 46 00:02:31.709 --> 00:02:35.491 we can create them in two concepts 47 00:02:35.491 --> 00:02:37.541 First is transformation 48 00:02:37.541 --> 00:02:41.179 We can design the matrix in the concept of a function 49 00:02:41.179 --> 00:02:46.613 Second, in the perspective of a vector within a space 50 00:02:46.613 --> 00:02:50.820 we can use a matrix to perform the transformation we want 51 00:02:50.820 --> 00:02:54.620 For the transformation in 2D vector space 52 00:02:54.620 --> 00:02:59.930 the matrix is expressed with the size 2x2 53 00:02:59.930 --> 00:03:05.286 Next, for the element of 2D vector space, which is 2D vector 54 00:03:05.286 --> 00:03:11.434 it's expressed with a matrix with 2 rows and 1 column 55 00:03:11.434 --> 00:03:14.084 So these matrices 56 00:03:14.084 --> 00:03:18.108 can be used as a calculating tool 57 00:03:18.108 --> 00:03:20.508 to transform a vector 58 00:03:20.508 --> 00:03:22.899 into the form we want 59 00:03:22.899 --> 00:03:25.724 First, I'll explain about the basic calculation method 60 00:03:25.724 --> 00:03:27.259 of a matrix 61 00:03:27.259 --> 00:03:30.309 Matrices have the adding operation 62 00:03:30.309 --> 00:03:34.609 This can only applied to 63 00:03:34.609 --> 00:03:37.380 matrices with the same size, rows, and columns 64 00:03:37.380 --> 00:03:39.820 You just need to add the numbers in each location 65 00:03:39.820 --> 00:03:41.259 Very easy, right? 66 00:03:41.259 --> 00:03:45.009 So take the number corresponding to the location of "a" 67 00:03:45.009 --> 00:03:49.140 add the two numbers together, assign it to that location 68 00:03:49.140 --> 00:03:51.820 then you can perform the adding operation 69 00:03:51.820 --> 00:03:53.920 Next, matrix and scalar 70 00:03:53.920 --> 00:03:58.129 When a scalar value "k" is assigned to a matrix 71 00:03:58.129 --> 00:04:00.648 you just need to perform a multiplication operation 72 00:04:00.648 --> 00:04:02.460 by multiplying "k" to all elements 73 00:04:02.460 --> 00:04:06.836 It's the same result as 74 00:04:06.836 --> 00:04:09.420 multiplying scalar to a vector 75 00:04:09.420 --> 00:04:12.220 Next, there's something called the transpose operation of a matrix 76 00:04:12.220 --> 00:04:15.820 This is processed using superscript T 77 00:04:15.820 --> 00:04:19.633 Transposing means switching 78 00:04:19.633 --> 00:04:21.594 We're switching the rows and columns 79 00:04:21.594 --> 00:04:24.980 Thus, rows become columns, and columns become rows 80 00:04:24.980 --> 00:04:30.230 When a matrix with 3 rows and 2 columns gets transposed 81 00:04:30.230 --> 00:04:34.630 it changes into a matrix with 2 rows and 3 columns 82 00:04:34.630 --> 00:04:38.404 As you can see here, it flips to the other side 83 00:04:38.404 --> 00:04:41.859 with "a" and "f" as the center point 84 00:04:41.859 --> 00:04:44.709 Using "a" and "f" as the pivot 85 00:04:44.709 --> 00:04:48.578 it flips to the other side 86 00:04:48.578 --> 00:04:51.660 That's the transformation it undergoes 87 00:04:51.660 --> 00:04:54.660 For square matrix, it looks the same even when you flip it 88 00:04:54.660 --> 00:04:56.110 because the rows and columns are the same 89 00:04:56.110 --> 00:04:59.019 Matrices with identical rows and columns are called square matrices 90 00:04:59.019 --> 00:05:03.619 In that case, keep "a" and "d" as-is 91 00:05:03.619 --> 00:05:09.398 and for the rest of the elements, "b" and "c" 92 00:05:09.398 --> 00:05:12.002 flip them to the other side 93 00:05:12.002 --> 00:05:14.779 then you have performed the transpose operation 94 00:05:14.779 --> 00:05:18.500 That's called the transpose operation 95 00:05:18.500 --> 00:05:22.140 The next important operation is the multiplication of matrices 96 00:05:22.140 --> 00:05:24.090 This is a bit complicated 97 00:05:24.090 --> 00:05:28.497 When there are two matrices like this 98 00:05:28.497 --> 00:05:31.297 the one on the left is the row 99 00:05:31.297 --> 00:05:33.978 We use its rows 100 00:05:33.978 --> 00:05:36.522 For the one on the right, we use its columns 101 00:05:36.522 --> 00:05:41.847 So criss-cross the rows and columns, and multiply 102 00:05:41.847 --> 00:05:44.370 Multiply and add each element 103 00:05:44.370 --> 00:05:48.550 Add the product of "a", "e" and the product of "b", "g" 104 00:05:48.550 --> 00:05:51.019 Then you will end up with "ae" plus "bg" 105 00:05:51.019 --> 00:05:54.852 For the second element, multiply "a" and "f" 106 00:05:54.852 --> 00:05:57.980 and add it to the product of "b" and "h" 107 00:05:57.980 --> 00:06:00.730 For the third one, row 2 column 1 108 00:06:00.730 --> 00:06:05.043 Multiply "c" and "e" and add it to the product of "d" and "g" 109 00:06:05.043 --> 00:06:09.761 For the fourth, final one, row 2 column 2 110 00:06:09.761 --> 00:06:15.402 Multiply "c" and "f", and add the product of "d" and "h" 111 00:06:15.402 --> 00:06:18.519 Just like that, cross the rows and columns 112 00:06:18.519 --> 00:06:20.660 and add the elements after multiplying them 113 00:06:20.660 --> 00:06:23.810 The multiplication operation is complicated 114 00:06:23.810 --> 00:06:27.619 so first-timers will have to practice many times 115 00:06:27.619 --> 00:06:30.775 Through these kinds of operation system 116 00:06:30.775 --> 00:06:34.786 we can calculate mechanically 117 00:06:34.786 --> 00:06:38.633 It's good to know about the characteristics of operations beforehand 118 00:06:38.633 --> 00:06:42.233 The characteristic of the multiplication operation of matrices 119 00:06:42.233 --> 00:06:46.551 is that it doesn't satisfy the commutative property 120 00:06:46.551 --> 00:06:50.876 That is, when matrices "a" and "b" are multiplied in reverse order 121 00:06:50.876 --> 00:06:54.292 we can't guarantee that the value will be the same 122 00:06:54.292 --> 00:06:55.530 We'll take a look 123 00:06:55.530 --> 00:06:59.330 When "a" and "b" are defined as matrices, like the following 124 00:06:59.330 --> 00:07:03.757 the first element will be ae+bg 125 00:07:03.757 --> 00:07:07.357 But if we switch these two 126 00:07:07.357 --> 00:07:10.879 it becomes ea+fc 127 00:07:10.879 --> 00:07:15.756 Since the commutative property is valid for ea 128 00:07:15.756 --> 00:07:18.700 the first is the same, but the second is bg 129 00:07:18.700 --> 00:07:20.303 and we get cf here 130 00:07:20.303 --> 00:07:22.380 So we can see that the value is different 131 00:07:22.380 --> 00:07:26.246 For the value to be the same even with the switched order 132 00:07:26.246 --> 00:07:30.081 a particular condition would have to be established 133 00:07:30.081 --> 00:07:32.081 Anyways, for normal cases 134 00:07:32.081 --> 00:07:34.859 the commutative property is not satisfied 135 00:07:34.859 --> 00:07:37.072 as you should know 136 00:07:37.072 --> 00:07:40.422 However, switching the order 137 00:07:40.422 --> 00:07:44.430 switching the multiplication order when calculating 138 00:07:44.430 --> 00:07:49.080 And by order, I mean the direction is the same 139 00:07:49.080 --> 00:07:51.656 Commutative property is when the direction itself 140 00:07:51.656 --> 00:07:55.006 the multiplying direction itself is flipped 141 00:07:55.006 --> 00:07:58.106 For associative property, the direction is the same 142 00:07:58.106 --> 00:08:00.256 but it's about whether multiplication is in the front or the back 143 00:08:00.256 --> 00:08:02.374 It's about whether we're multiplying the front first or the back first 144 00:08:02.374 --> 00:08:03.871 That's the difference 145 00:08:03.871 --> 00:08:06.471 So as long as we maintain the same direction 146 00:08:06.471 --> 00:08:08.565 whether we multiply the front first or the back first 147 00:08:08.565 --> 00:08:11.500 the result will be the same 148 00:08:11.500 --> 00:08:14.823 I will explain about these properties of a matrix later 149 00:08:14.823 --> 00:08:18.288 but this gives you a very important, big advantage 150 00:08:18.288 --> 00:08:21.540 The property of a matrix satisfies the associative property 151 00:08:21.540 --> 00:08:25.140 Since it satisfies like this 152 00:08:25.140 --> 00:08:27.714 whether we multiply first or later 153 00:08:27.714 --> 00:08:31.420 you can understand that the results are the same 154 00:08:31.420 --> 00:08:34.120 The third thing we need to know 155 00:08:34.120 --> 00:08:40.431 is the transpose of the products of matrices 156 00:08:40.431 --> 00:08:46.802 When multiplied products are transposed 157 00:08:46.802 --> 00:08:52.452 it's the same thing as multiplying 158 00:08:52.452 --> 00:08:54.594 the transposed matrices 159 00:08:54.594 --> 00:09:00.294 What that means, is that 160 00:09:00.294 --> 00:09:03.881 when we multiply the matrices "A" and "B" 161 00:09:03.881 --> 00:09:10.500 the transpose matrix of this would be ehfg 162 00:09:10.500 --> 00:09:14.460 And the transpose of this would be adbc 163 00:09:14.460 --> 00:09:17.510 But multiplying first 164 00:09:17.510 --> 00:09:20.659 has the same results as 165 00:09:20.659 --> 00:09:24.260 transposing, and then multiplying 166 00:09:24.260 --> 00:09:26.380 Then we end up with this kind of formula 167 00:09:26.380 --> 00:09:30.979 We're going to use it later, so it would be good to know 168 00:09:30.979 --> 00:09:34.968 Next, although it is complicated, it also satisfies the distributive property 169 00:09:34.968 --> 00:09:36.979 which uses the multiplication and addition of matrices 170 00:09:36.979 --> 00:09:39.980 The calculation is complicated, so I didn't write it down but 171 00:09:39.980 --> 00:09:42.260 just know that it is satisfied 172 00:09:42.260 --> 00:09:44.272 Actually, it's good to know but 173 00:09:44.272 --> 00:09:45.822 among what we're going to learn right now 174 00:09:45.822 --> 00:09:47.472 distributive property won't be used 175 00:09:47.472 --> 00:09:50.492 That's why I didn't write it down 176 00:09:50.492 --> 00:09:52.892 We now learned about the characteristics 177 00:09:52.892 --> 00:09:54.901 of basic operations 178 00:09:54.901 --> 00:09:57.301 Then why do we use matrices? 179 00:09:57.301 --> 00:10:00.260 I've briefly mentioned earlier, but 180 00:10:00.260 --> 00:10:03.760 in linear transformation, maintaining the structure of the vector space as-is 181 00:10:03.760 --> 00:10:06.878 while also having linearity 182 00:10:06.878 --> 00:10:10.528 and transforming into a new space, this process itself 183 00:10:10.528 --> 00:10:13.978 can be corresponded to a matrix, and that's the merit 184 00:10:13.978 --> 00:10:16.659 Therefore, rather than calculating each linear transformation 185 00:10:16.659 --> 00:10:19.859 simply using matrices 186 00:10:19.859 --> 00:10:22.783 to organize them and conduct multiplication 187 00:10:22.783 --> 00:10:25.473 we quickly can perform the wanted linear transformation 188 00:10:25.473 --> 00:10:27.780 Because of that merit, we use matrices 189 00:10:27.780 --> 00:10:29.785 We'll learn about how matrices 190 00:10:29.785 --> 00:10:32.299 correspond to linear transformation 191 00:10:32.299 --> 00:10:35.349 Earlier, we said that vector functions, like the following 192 00:10:35.349 --> 00:10:40.726 satisfy linearity 193 00:10:40.726 --> 00:10:45.623 When we combine two independent elements, x and y 194 00:10:45.623 --> 00:10:51.129 to make a vector, and change that in some form 195 00:10:51.129 --> 00:10:55.318 and when we make the first and second elements 196 00:10:55.318 --> 00:10:59.986 with this combination of linear equation, with no impurities 197 00:10:59.986 --> 00:11:02.640 then in the vector space R2 198 00:11:02.640 --> 00:11:05.820 it's a linear transformation that has correspondence to 199 00:11:05.820 --> 00:11:07.291 R2 200 00:11:07.291 --> 00:11:10.641 Same thing with this, when I define 201 00:11:10.641 --> 00:11:13.923 an arbitrary matrix as abcd 202 00:11:13.923 --> 00:11:17.269 and an arbitrary vector as x, y 203 00:11:17.269 --> 00:11:21.169 then based on the rule of multiplication of matrices 204 00:11:21.169 --> 00:11:24.069 the result of the matrix is like the following 205 00:11:24.069 --> 00:11:28.602 The first element is ax+by 206 00:11:28.602 --> 00:11:31.402 and the second element is cx+dy 207 00:11:31.402 --> 00:11:33.663 It is made into a vector 208 00:11:33.663 --> 00:11:36.203 If you look here 209 00:11:36.203 --> 00:11:39.653 the original x, y corresponds to this vector 210 00:11:39.653 --> 00:11:41.353 and then the result 211 00:11:41.353 --> 00:11:45.844 of using the vector function 212 00:11:45.844 --> 00:11:48.694 is the same as 213 00:11:48.694 --> 00:11:50.566 ax+by, cx+dy 214 00:11:50.566 --> 00:11:55.463 Then this matrix, abcd, ultimately 215 00:11:55.463 --> 00:12:02.503 corresponds x and y to a point in ax+by, cx+dy 216 00:12:02.503 --> 00:12:06.160 in a linear transformation 217 00:12:06.160 --> 00:12:11.643 Thus, it conducts the role of a function 218 00:12:11.643 --> 00:12:15.479 Then now we're ready to conduct linear transformation 219 00:12:15.479 --> 00:12:19.579 using these matrices 220 00:12:19.579 --> 00:12:21.756 Before getting into it 221 00:12:21.756 --> 00:12:24.556 there are two ways to express a matrix 222 00:12:24.556 --> 00:12:28.163 There's the column major matrix, and the row major matrix 223 00:12:28.163 --> 00:12:31.440 Usually, when you use computer graphics 224 00:12:31.440 --> 00:12:35.140 or make an independent game engine 225 00:12:35.140 --> 00:12:39.659 there are two ways to use the matrix 226 00:12:39.659 --> 00:12:42.909 The normal way we use is 227 00:12:42.909 --> 00:12:47.706 treating the vector as the column during calculation 228 00:12:47.706 --> 00:12:49.906 And we make the matrix into a square matrix 229 00:12:49.906 --> 00:12:51.405 Make the function into a square matrix 230 00:12:51.405 --> 00:12:56.405 The result is also a column vector, as we call it 231 00:12:56.405 --> 00:12:59.933 We can see that it is made into a column vector 232 00:12:59.933 --> 00:13:03.973 This notation method is called OPEN GL 233 00:13:03.973 --> 00:13:05.323 In graphic libraries 234 00:13:05.323 --> 00:13:07.273 or when we conduct matrices in normal math 235 00:13:07.273 --> 00:13:09.684 we often use this method 236 00:13:09.684 --> 00:13:12.560 Since this expresses the vector as column 237 00:13:12.560 --> 00:13:15.960 it's called a column major matrix 238 00:13:15.960 --> 00:13:19.344 However, there's also a way to express based on the row 239 00:13:19.344 --> 00:13:22.344 This method expresses the vector as a row 240 00:13:22.344 --> 00:13:24.640 And 241 00:13:24.640 --> 00:13:26.890 when we use DirectX or something 242 00:13:26.890 --> 00:13:31.100 to implement the game engine ourselves 243 00:13:31.100 --> 00:13:34.297 or when we take a look at the source of business engines 244 00:13:34.297 --> 00:13:38.347 some cases are written as row major matrix 245 00:13:38.347 --> 00:13:41.552 When we use the vector as a row 246 00:13:41.552 --> 00:13:45.402 we spread out x, y horizontally 247 00:13:45.402 --> 00:13:49.201 and its order comes to the front 248 00:13:49.201 --> 00:13:54.140 And when we look at abcd 249 00:13:54.140 --> 00:13:58.923 this one is arranged in horizontal order 250 00:13:58.923 --> 00:14:02.423 but here, abcd is arranged in a vertical order 251 00:14:02.423 --> 00:14:04.979 Then the direction would change now 252 00:14:04.979 --> 00:14:07.529 Finally, for the result of calculating this 253 00:14:07.529 --> 00:14:09.979 since we calculate the row and column 254 00:14:09.979 --> 00:14:12.876 ax+by is correct 255 00:14:12.876 --> 00:14:17.099 And then cx+dy, the values are the same 256 00:14:17.099 --> 00:14:18.852 However, this has a result of a column 257 00:14:18.852 --> 00:14:22.612 but this has a result of a row 258 00:14:22.612 --> 00:14:26.862 Then let's say 259 00:14:26.862 --> 00:14:29.120 we made a new vector on a vector 260 00:14:29.120 --> 00:14:34.604 When ax+by, cx+dy is set as v' 261 00:14:34.604 --> 00:14:36.829 and when x, y is set as v 262 00:14:36.829 --> 00:14:39.929 it gets this form of equation 263 00:14:39.929 --> 00:14:41.729 in column major matrix 264 00:14:41.729 --> 00:14:47.257 But when we change this into row major 265 00:14:47.257 --> 00:14:50.815 the result, v' 266 00:14:50.815 --> 00:14:54.940 v', expressed in column major, is now changed 267 00:14:54.940 --> 00:14:56.390 into row major 268 00:14:56.390 --> 00:15:01.571 Then changing the v' of column major into a row major 269 00:15:01.571 --> 00:15:03.886 ultimately means transposing 270 00:15:03.886 --> 00:15:06.736 Transposing this is taking Av 271 00:15:06.736 --> 00:15:09.136 the equation we used earlier to make this 272 00:15:09.136 --> 00:15:11.843 this equation of multiplying matrix A and v 273 00:15:11.843 --> 00:15:15.348 will be like transposed in the result 274 00:15:15.348 --> 00:15:18.748 What that becomes is 275 00:15:18.748 --> 00:15:22.063 transposing a product of matrices 276 00:15:22.063 --> 00:15:23.604 is the same as switching the two 277 00:15:23.604 --> 00:15:26.833 and multiplying the transpose of each 278 00:15:26.833 --> 00:15:29.283 Therefore, for this equation 279 00:15:29.283 --> 00:15:35.916 put the transposed v^T first 280 00:15:35.916 --> 00:15:41.316 and put the transposed matrix A in the back 281 00:15:41.316 --> 00:15:44.780 It's the same result of calculation 282 00:15:44.780 --> 00:15:48.980 When we use the vector as the column 283 00:15:48.980 --> 00:15:51.719 here's the difference between using it as the column 284 00:15:51.719 --> 00:15:53.288 and using it as the row 285 00:15:53.288 --> 00:15:57.290 The matrix that actually conducts the transformation 286 00:15:57.290 --> 00:15:59.290 has a simple difference 287 00:15:59.290 --> 00:16:00.609 in the transposition 288 00:16:00.609 --> 00:16:03.609 The only difference is the A and A^T 289 00:16:03.609 --> 00:16:08.940 Therefore, using row major versus column major 290 00:16:08.940 --> 00:16:10.740 doesn't make a big difference 291 00:16:10.740 --> 00:16:14.388 For the matrix that actually conducts transformation 292 00:16:14.388 --> 00:16:17.620 row major method is simply transposing 293 00:16:17.620 --> 00:16:20.413 the matrix used in column major 294 00:16:20.413 --> 00:16:21.613 Same goes for the other way 295 00:16:21.613 --> 00:16:23.459 If you want to use it as row major 296 00:16:23.459 --> 00:16:26.859 same thing, simply transpose it 297 00:16:26.859 --> 00:16:31.937 The one we'll talk about in this lesson 298 00:16:31.937 --> 00:16:33.787 is column major 299 00:16:33.787 --> 00:16:37.038 but if you are using other DirectX or referring to 300 00:16:37.038 --> 00:16:39.988 source codes of Unreal Engine, and you find a matrix 301 00:16:39.988 --> 00:16:43.374 they will be expressed as row major 302 00:16:43.374 --> 00:16:45.739 Since they're different, you might think that you have to 303 00:16:45.739 --> 00:16:49.735 learn it again from the start, but it will be solved by simply 304 00:16:49.735 --> 00:16:51.585 transposing it 305 00:16:51.585 --> 00:16:56.739 I summarized it here because it would be good to know 306 00:16:56.739 --> 00:16:59.539 To see how matrices that conduct these linear transformation 307 00:16:59.539 --> 00:17:02.500 get changed 308 00:17:02.500 --> 00:17:06.535 we'll draw an actual picture 309 00:17:06.535 --> 00:17:08.735 Before the transformation 310 00:17:08.735 --> 00:17:11.142 let's say there's a vector space 311 00:17:11.142 --> 00:17:14.459 The x, y here is 312 00:17:14.459 --> 00:17:18.609 Actually, the x and y 313 00:17:18.609 --> 00:17:23.859 are combined in a uniform, equal relationship 314 00:17:23.859 --> 00:17:26.309 with no interference 315 00:17:26.309 --> 00:17:31.483 So for the arbitrary point x, y 316 00:17:31.483 --> 00:17:36.009 if we think about the structure of how it is created 317 00:17:36.009 --> 00:17:39.540 e1 and e2 of a standard basis vector 318 00:17:39.540 --> 00:17:45.590 were each multiplied by x and y, then added together 319 00:17:45.590 --> 00:17:48.335 Through a combined equation like this 320 00:17:48.335 --> 00:17:53.200 the vector was created in the vector space 321 00:17:53.200 --> 00:17:56.000 Then some space was changed 322 00:17:56.000 --> 00:17:59.000 Actually, a space contains infinite elements 323 00:17:59.000 --> 00:18:01.000 therefore, tracking down all the infinite elements 324 00:18:01.000 --> 00:18:03.592 and analyzing each correspondence 325 00:18:03.592 --> 00:18:05.663 is actually close to impossible 326 00:18:05.663 --> 00:18:09.376 However, if we analyze the movement of the basis vector 327 00:18:09.376 --> 00:18:13.356 which is the foundation holding up the space 328 00:18:13.356 --> 00:18:17.267 then even if we don't check every single element 329 00:18:17.267 --> 00:18:19.017 we can visually predict 330 00:18:19.017 --> 00:18:21.000 how the space will change 331 00:18:21.000 --> 00:18:23.250 Through those predictions, we can have the wanted effect 332 00:18:23.250 --> 00:18:25.713 by tracking backwards 333 00:18:25.713 --> 00:18:29.525 So the original space had two foundations 334 00:18:29.525 --> 00:18:33.634 That was, the standard basis vector, E1 and E2 335 00:18:33.634 --> 00:18:35.584 And it was changed 336 00:18:35.584 --> 00:18:39.624 The point in the changed space 337 00:18:39.624 --> 00:18:42.713 was changed like this 338 00:18:42.713 --> 00:18:47.713 The first standard basis vector corresponding to (1, 0) is (a,c) 339 00:18:47.713 --> 00:18:54.663 and the second standard basis vector is (b, d) 340 00:18:54.663 --> 00:18:57.763 Then the vector (1, 1) made by 341 00:18:57.763 --> 00:19:02.178 combining these with 1 to 1 proportion 342 00:19:02.178 --> 00:19:04.228 changes into this form 343 00:19:04.228 --> 00:19:07.386 All the vectors in the space change this way 344 00:19:07.386 --> 00:19:12.396 Of course, the elements are infinite, so even if the space is changed 345 00:19:12.396 --> 00:19:14.446 this flat surface 346 00:19:14.446 --> 00:19:18.743 will eventually create infinite flat surfaces 347 00:19:18.743 --> 00:19:25.000 But the process of making that 348 00:19:25.000 --> 00:19:28.750 is the same as applying 349 00:19:28.750 --> 00:19:31.000 this matrix we talked about earlier 350 00:19:31.000 --> 00:19:33.832 It's the same 351 00:19:33.832 --> 00:19:38.406 So ax+by, cx+dy 352 00:19:38.406 --> 00:19:42.000 Applying this linear transformation is the same 353 00:19:42.000 --> 00:19:45.000 This is how it's applied 354 00:19:45.000 --> 00:19:50.158 On x, multiply (a, c) 355 00:19:50.158 --> 00:19:53.408 Then on y, multiply (b, d) 356 00:19:53.408 --> 00:19:56.238 and the results are the same 357 00:19:56.238 --> 00:20:02.198 On an arbitrary point 358 00:20:02.198 --> 00:20:04.548 we multiplied x on the first basis vector 359 00:20:04.548 --> 00:20:07.000 and multiplied y on the second basis vector 360 00:20:07.000 --> 00:20:10.400 Just like that, on a changed vector of (1, 0) 361 00:20:10.400 --> 00:20:15.000 which is (a, c), we multiply x 362 00:20:15.000 --> 00:20:16.604 We applied the same proportion 363 00:20:16.604 --> 00:20:20.354 And on the changed vector of (0, 1), which is (b, d) 364 00:20:20.354 --> 00:20:23.000 we apply y 365 00:20:23.000 --> 00:20:29.208 and it proceeds the same way as the linear transformation from earlier 366 00:20:29.208 --> 00:20:33.564 Then here, this value of the matrix 367 00:20:33.564 --> 00:20:35.762 which we mentioned as corresponding to linear transformation 368 00:20:35.762 --> 00:20:40.772 when we look at the column vector, not the row 369 00:20:40.772 --> 00:20:44.000 there are two column vectors 370 00:20:44.000 --> 00:20:49.600 This 2x2 matrix, corresponding to the function 371 00:20:49.600 --> 00:20:50.881 can be seen as the column vector 372 00:20:50.881 --> 00:20:54.594 Here, the first column vector is (a, c) 373 00:20:54.594 --> 00:20:57.680 It stands for the changed value of 374 00:20:57.680 --> 00:20:59.238 the first basis vector 375 00:20:59.238 --> 00:21:03.388 And (b, d), corresponding to the second column 376 00:21:03.388 --> 00:21:07.475 is the changed value of the second basis vector 377 00:21:07.475 --> 00:21:11.000 Therefore, we're tracking the difference of this basis vector 378 00:21:11.000 --> 00:21:12.218 That's what using a matrix is 379 00:21:12.218 --> 00:21:15.564 Using this matrix designed as abcd 380 00:21:15.564 --> 00:21:19.426 is actually looking at the column vector 381 00:21:19.426 --> 00:21:22.683 and identifying the two standard basis vectors 382 00:21:22.683 --> 00:21:27.083 that each change into (a, c) and (b, d) 383 00:21:27.083 --> 00:21:29.168 in this process 384 00:21:29.168 --> 00:21:32.068 When we think of it this way, then we can easily design 385 00:21:32.068 --> 00:21:34.000 the transformation we want 386 00:21:34.000 --> 00:21:37.000 For example, we'll take a look at the scale transformation matrix 387 00:21:37.000 --> 00:21:42.742 Let's say there's this basic object in the original space 388 00:21:42.742 --> 00:21:45.356 and I want to stretch this horizontally 389 00:21:45.356 --> 00:21:49.000 We'll stretch it "a" times 390 00:21:49.000 --> 00:21:53.990 And vertically, we'll shrink it "b" times 391 00:21:53.990 --> 00:21:56.940 Then each basis vector turns out this way 392 00:21:56.940 --> 00:22:00.366 (1, 0) increases to (a, 0) 393 00:22:00.366 --> 00:22:04.554 and (0, 1) decreases to (0, b) 394 00:22:04.554 --> 00:22:06.000 When this is expressed as a matrix 395 00:22:06.000 --> 00:22:10.584 each of the changed basis vector, (a, 0) and (0, b) 396 00:22:10.584 --> 00:22:14.307 just needs to be inserted as the column vector 397 00:22:14.307 --> 00:22:17.337 Then it's made into a 2x2 matrix 398 00:22:17.337 --> 00:22:21.802 that actually conducts the transformation 399 00:22:21.802 --> 00:22:26.000 To actually try it out, when x, y vector is multiplied here 400 00:22:26.000 --> 00:22:35.139 it becomes the matrix ax, by 401 00:22:35.139 --> 00:22:42.148 Here, the x was multiplied by a, and y was multiplied by b 402 00:22:42.148 --> 00:22:45.000 and it can be seen as a linear transformation 403 00:22:45.000 --> 00:22:48.445 It corresponds to scale transformation 404 00:22:48.445 --> 00:22:50.594 We'll now think of translation 405 00:22:50.594 --> 00:22:54.000 I'll translate a space to the side like this 406 00:22:54.000 --> 00:22:58.000 When we leave one side as-is, and push the other side 407 00:22:58.000 --> 00:23:01.000 since x-axis is fixed, it stays as-is 408 00:23:01.000 --> 00:23:04.000 Then the first basis vector has no change 409 00:23:04.000 --> 00:23:06.525 Just use the (1, 0) as-is 410 00:23:06.525 --> 00:23:10.000 When we slant it one unit to the side 411 00:23:10.000 --> 00:23:13.257 the (0, 1) vector changes into (1, 1) 412 00:23:13.257 --> 00:23:16.852 Then, we just insert (1, 1) into the second column 413 00:23:16.852 --> 00:23:22.552 This is the translation of 414 00:23:22.552 --> 00:23:25.416 pushing y-axis one unit toward the x-axis 415 00:23:25.416 --> 00:23:28.228 If we pushed it "a" times 416 00:23:28.228 --> 00:23:33.000 then just replace it with (a, 1) 417 00:23:33.000 --> 00:23:38.218 and we'll end up with a matrix with the wanted amount of translation 418 00:23:38.218 --> 00:23:44.218 That's how you can design the matrix 419 00:23:44.218 --> 00:23:47.218 This time, we'll think about rotation, 90 degrees 420 00:23:47.218 --> 00:23:48.188 clockwise 421 00:23:48.188 --> 00:23:52.139 For rotation, we mentioned earlier but 422 00:23:52.139 --> 00:23:57.000 the size of the two basis vectors are the same as the original 423 00:23:57.000 --> 00:24:01.050 and it maintains 90 degrees, and the direction of the 90 degrees 424 00:24:01.050 --> 00:24:04.000 also stay the same 425 00:24:04.000 --> 00:24:08.000 This way, the shape of the object is maintained 426 00:24:08.000 --> 00:24:14.297 Therefore, rotation keeps the shape of the object as-is 427 00:24:14.297 --> 00:24:19.000 but changes the direction 428 00:24:19.000 --> 00:24:21.455 When we rotate it 90 degrees clockwise 429 00:24:21.455 --> 00:24:26.852 x-axis would to go negative y-axis, and y-axis would become x-axis 430 00:24:26.852 --> 00:24:29.702 It would become like this 431 00:24:29.702 --> 00:24:32.614 Then since the difference of x-axis is 0, -1 432 00:24:32.614 --> 00:24:34.693 make this the first column 433 00:24:34.693 --> 00:24:36.693 And put (1, 0) in the second column 434 00:24:36.693 --> 00:24:38.901 Then you get a 90 degrees rotation 435 00:24:38.901 --> 00:24:43.614 It becomes a rotation that rotates 90 degrees clockwise 436 00:24:43.614 --> 00:24:48.396 If we actually multiply this 437 00:24:48.396 --> 00:24:54.941 If we multiply the actual vectors, x and y 438 00:24:54.941 --> 00:24:58.465 the result becomes x 439 00:24:58.465 --> 00:25:02.792 When we multiply the matrix of x and y 440 00:25:02.792 --> 00:25:04.950 the first element would become y 441 00:25:04.950 --> 00:25:09.000 and the second element would become -x 442 00:25:09.000 --> 00:25:12.000 So 90 degrees rotation means 443 00:25:12.000 --> 00:25:14.307 flipping x and y 444 00:25:14.307 --> 00:25:18.743 and putting a negative sign on the y value 445 00:25:18.743 --> 00:25:21.993 Put the opposite sign on it 446 00:25:21.993 --> 00:25:23.574 and it gets solved right away, actually 447 00:25:23.574 --> 00:25:25.544 Even if we don't use a matrix 448 00:25:25.544 --> 00:25:29.356 we can obtain it right away by swapping 449 00:25:29.356 --> 00:25:31.556 This time, we'll learn about the 450 00:25:31.556 --> 00:25:33.297 90 degrees counterclockwise rotation 451 00:25:33.297 --> 00:25:38.673 As we've seen earlier, we can predict it right away 452 00:25:38.673 --> 00:25:42.386 Counterclockwise means it's turning this way 453 00:25:42.386 --> 00:25:46.000 That means the y-axis became -x 454 00:25:46.000 --> 00:25:48.238 and the x-axis became the y-axis 455 00:25:48.238 --> 00:25:51.099 So since y-axis became -x 456 00:25:51.099 --> 00:25:53.416 and x-axis became the y-axis 457 00:25:53.416 --> 00:25:58.663 it means a rotation of (0, 1), (-1, 0) 458 00:25:58.663 --> 00:26:00.564 For this, it's the same 459 00:26:00.564 --> 00:26:04.000 Swap the two 460 00:26:04.000 --> 00:26:07.307 and put the opposite sign on the first element 461 00:26:07.307 --> 00:26:10.495 Then you can calculate it right away 462 00:26:10.495 --> 00:26:13.733 With that, we learned about the 90 degrees rotation 463 00:26:13.733 --> 00:26:17.386 How would the rotation of an arbitrary value, theta, work? 464 00:26:17.386 --> 00:26:20.286 For this, it's the same method as 465 00:26:20.286 --> 00:26:22.742 when we used trigonometric functions last time 466 00:26:22.742 --> 00:26:25.327 For each of the two standard basis vectors 467 00:26:25.327 --> 00:26:28.663 When the first standard basis vector is rotated θ degrees 468 00:26:28.663 --> 00:26:34.277 this moves to point (cosθ, sinθ) 469 00:26:34.277 --> 00:26:37.594 And when (0, 1) is rotated θ degrees 470 00:26:37.594 --> 00:26:44.228 the vector moves to (-sinθ, cosθ) 471 00:26:44.228 --> 00:26:46.178 Then how would we make 472 00:26:46.178 --> 00:26:47.822 the rotation matrix that corresponds to this? 473 00:26:47.822 --> 00:26:50.663 Set (cosθ, sinθ) as the first column 474 00:26:50.663 --> 00:26:56.000 and (-sinθ, cosθ) as the second column 475 00:26:56.000 --> 00:26:59.200 This way, you can implement a rotation 476 00:26:59.200 --> 00:27:03.000 on an arbitrary value of θ 477 00:27:03.000 --> 00:27:07.396 When you make a matrix like this and try multiplying x and y 478 00:27:07.396 --> 00:27:13.000 the result gives you xcosθ-ysinθ as the first element 479 00:27:13.000 --> 00:27:17.139 and xsinθ+ycosθ as the second element 480 00:27:17.139 --> 00:27:21.000 This is the same result as 481 00:27:21.000 --> 00:27:25.000 the calculated value from trigonometric functions earlier 482 00:27:25.000 --> 00:27:28.550 Therefore, from now on, if we're rotating a vector 483 00:27:28.550 --> 00:27:31.000 with a value of θ 484 00:27:31.000 --> 00:27:35.396 think of the coordinates of these two basis vectors 485 00:27:35.396 --> 00:27:39.495 Since they're similar right triangles 486 00:27:39.495 --> 00:27:43.000 the y value here becomes x value, the opposite way 487 00:27:43.000 --> 00:27:50.000 and here, the x value becomes the y value 488 00:27:50.000 --> 00:27:54.683 Therefore, you can see that the first (cosθ, sinθ) 489 00:27:54.683 --> 00:28:01.227 becomes (-sinθ, cosθ) for the y value 490 00:28:01.227 --> 00:28:06.000 As long as you clearly know these two vectors 491 00:28:06.000 --> 00:28:08.505 you just need to insert them here one by one 492 00:28:08.505 --> 00:28:12.555 cosθ, sinθ, -sinθ, cosθ 493 00:28:12.555 --> 00:28:15.000 This becomes the rotation matrix 494 00:28:15.000 --> 00:28:19.000 With that, we learned about the three basic transformations 495 00:28:19.000 --> 00:28:22.000 that we'll need from now on 496 00:28:22.000 --> 00:28:26.198 Those were, scaling, translation, and rotation 497 00:28:26.198 --> 00:28:29.000 We learned about these three types 498 00:28:29.000 --> 00:28:30.750 and how each of these 499 00:28:30.750 --> 00:28:33.752 are expressed as matrix 500 00:28:33.752 --> 00:28:36.902 Then finally, we're going to talk about 501 00:28:36.902 --> 00:28:38.940 the multiplication of matrix 502 00:28:38.940 --> 00:28:41.290 They say that matrix is simple but 503 00:28:41.290 --> 00:28:46.000 we don't necessarily use matrices just because they're simple 504 00:28:46.000 --> 00:28:48.850 There's a very important characteristic 505 00:28:48.850 --> 00:28:51.000 that the matrix has 506 00:28:51.000 --> 00:28:54.000 We can also call it the characteristic of matrix multiplication 507 00:28:54.000 --> 00:28:56.614 Let's learn about it 508 00:28:56.614 --> 00:29:01.000 Let's say that there are three vector spaces, like below 509 00:29:01.000 --> 00:29:06.406 Let's say that each is real vector space R2 510 00:29:06.406 --> 00:29:09.317 Then if we apply linear transformation twice 511 00:29:09.317 --> 00:29:11.817 the vector space will be transformed twice 512 00:29:11.817 --> 00:29:17.000 and it will ultimately proceed into a new vector space 513 00:29:17.000 --> 00:29:20.356 We'll call the first transformation Matrix B 514 00:29:20.356 --> 00:29:25.000 and we'll call the second transformation Matrix A 515 00:29:25.000 --> 00:29:30.700 If we say that it will go through two transformations 516 00:29:30.700 --> 00:29:33.653 and if we express this in an equation 517 00:29:33.653 --> 00:29:37.436 multiply the element V, of the first vector space 518 00:29:37.436 --> 00:29:40.643 with matrix B 519 00:29:40.643 --> 00:29:44.343 then, you'll ultimately get the element of the second vector space 520 00:29:44.343 --> 00:29:46.109 which is vector u 521 00:29:46.109 --> 00:29:49.654 When you multiply vector u with matrix A 522 00:29:49.654 --> 00:29:53.404 it proceeds to the last vector w 523 00:29:53.404 --> 00:29:55.465 That is expressed in this equation 524 00:29:55.465 --> 00:29:58.665 But for matrix, I've mentioned earlier that 525 00:29:58.665 --> 00:30:00.396 the associative property stands 526 00:30:00.396 --> 00:30:04.520 Therefore, we'll try calculating this equation after switching the order 527 00:30:04.520 --> 00:30:11.640 Then w has the same result as 528 00:30:11.640 --> 00:30:14.640 v multiplied to 529 00:30:14.640 --> 00:30:18.799 the product of matrix A and B 530 00:30:18.799 --> 00:30:21.840 Then let me explain what this is 531 00:30:21.840 --> 00:30:27.919 Matrix of A and B multiplied is also a square matrix, after all 532 00:30:27.919 --> 00:30:30.651 It's a 2x2 square matrix 533 00:30:30.651 --> 00:30:35.599 What the square matrix itself means is 534 00:30:35.599 --> 00:30:41.599 it serves the same role as a composite function 535 00:30:41.599 --> 00:30:45.880 which goes directly from vector space V to vector space W 536 00:30:45.880 --> 00:30:47.780 As mentioned earlier, a matrix is 537 00:30:47.780 --> 00:30:50.239 a linear transformation, and transformation is morphism 538 00:30:50.239 --> 00:30:52.320 and morphism is ultimately a function 539 00:30:52.320 --> 00:30:57.520 Therefore, for the result of multiplying these two matrices 540 00:30:57.520 --> 00:31:01.200 we can ultimately say that matrix corresponds to function 541 00:31:01.200 --> 00:31:04.200 and this brings the same result 542 00:31:04.200 --> 00:31:06.550 as the concept of composite function 543 00:31:06.550 --> 00:31:08.960 that we learned earlier 544 00:31:08.960 --> 00:31:11.960 Normally, when we learn about trigonometric functions 545 00:31:11.960 --> 00:31:13.599 we learn a lot about the addition formula 546 00:31:13.599 --> 00:31:14.640 and memorize them 547 00:31:14.640 --> 00:31:21.000 cos(α+β) is CCSS, that's how I learned it 548 00:31:21.000 --> 00:31:24.550 And the addition formula for the sine function is 549 00:31:24.550 --> 00:31:28.400 SCCS, that's how I learned it 550 00:31:28.400 --> 00:31:32.750 Rather than just memorizing it 551 00:31:32.750 --> 00:31:36.039 we're going to actually act it out using matrix multiplication 552 00:31:36.039 --> 00:31:39.799 Here, let's say that we first rotate it by α degrees 553 00:31:39.799 --> 00:31:44.080 and then rotate it by β degrees 554 00:31:44.080 --> 00:31:46.980 Rotating it by α degrees first 555 00:31:46.980 --> 00:31:49.239 and then rotating it by β degrees 556 00:31:49.239 --> 00:31:53.189 is obviously the same as 557 00:31:53.189 --> 00:31:55.440 rotating it by α+β degrees 558 00:31:55.440 --> 00:31:59.190 Then taking the result from α degree rotation 559 00:31:59.190 --> 00:32:02.760 and the result from β degree rotation 560 00:32:02.760 --> 00:32:07.239 and multiplying the two transformations 561 00:32:07.239 --> 00:32:10.889 is the same as 562 00:32:10.889 --> 00:32:12.719 rotating once by α+β degrees 563 00:32:12.719 --> 00:32:17.359 Therefore, I wrote down the α degree rotation here 564 00:32:17.359 --> 00:32:19.880 Multiplying these together is the same as what? 565 00:32:19.880 --> 00:32:24.719 The same as applying α+β 566 00:32:24.719 --> 00:32:30.640 Then here, we just need to take a look at the first column 567 00:32:30.640 --> 00:32:33.919 Cos(α+β) is the same as 568 00:32:33.919 --> 00:32:42.239 CCSS, thus (cos α·cos β)+(-sin α·sin β) 569 00:32:42.239 --> 00:32:48.080 And for sin(α+β), we usually call it SCCS 570 00:32:48.080 --> 00:32:52.760 (sin α·cos β) and then (cos α·sin β) 571 00:32:52.760 --> 00:32:56.560 The order has changed, but since the associative property stands 572 00:32:56.560 --> 00:32:59.520 we can call it SCCS 573 00:32:59.520 --> 00:33:03.970 So it's the same as this, and I left this as a question mark but 574 00:33:03.970 --> 00:33:05.919 the rest are actually the same as well 575 00:33:05.919 --> 00:33:10.969 Ultimately, the second element here 576 00:33:10.969 --> 00:33:15.280 The first and second elements of column 2 are all the same 577 00:33:15.280 --> 00:33:18.960 This corresponds to -sin(α+β) 578 00:33:18.960 --> 00:33:23.799 and this corresponds to cos(α+β) 579 00:33:23.799 --> 00:33:26.399 So later, by any chance 580 00:33:26.399 --> 00:33:29.799 if you can't remember the addition formula of trigonometric functions 581 00:33:29.799 --> 00:33:34.387 use the rotation of trigonometric functions 582 00:33:34.387 --> 00:33:39.280 then you'll be able to proceed right away 583 00:33:39.280 --> 00:33:42.239 I hope you use it usefully 584 00:33:42.239 --> 00:33:45.389 Finally, we'll talk about the advantages of 585 00:33:45.389 --> 00:33:47.760 multiplication of matrices 586 00:33:47.760 --> 00:33:51.310 As mentioned earlier, the associative property holds true for matrix 587 00:33:51.310 --> 00:33:54.320 so the order doesn't matter 588 00:33:54.320 --> 00:33:57.570 Doing this first, as long as the direction is the same 589 00:33:57.570 --> 00:34:00.367 the order doesn't matter 590 00:34:00.367 --> 00:34:07.599 Normally, the transformation is applied on the vector 591 00:34:07.599 --> 00:34:10.919 and another transformation is applied on the new vector 592 00:34:10.919 --> 00:34:13.369 and then another transformation on the new vector 593 00:34:13.369 --> 00:34:15.359 That's how we should proceed 594 00:34:15.359 --> 00:34:20.559 But after all, it's the same as 595 00:34:20.559 --> 00:34:25.159 multiplying the transformation matrices first 596 00:34:25.159 --> 00:34:27.409 and then multiplying 597 00:34:27.409 --> 00:34:30.039 the original vector 598 00:34:30.039 --> 00:34:33.239 From now on, when we 599 00:34:33.239 --> 00:34:35.599 basically express something on the computer 600 00:34:35.599 --> 00:34:38.449 we go through a lot of linear transformation processes 601 00:34:38.449 --> 00:34:42.000 We go through at least these 5 processes 602 00:34:42.000 --> 00:34:45.632 Scale, rotation, translation, view, and projection 603 00:34:45.632 --> 00:34:48.000 are the five processes 604 00:34:48.000 --> 00:34:49.599 It means there are five types of these 605 00:34:49.599 --> 00:34:53.727 The transformation itself is A, B, C, D, and E 606 00:34:53.727 --> 00:34:55.427 Rather than calling it A, B, C, D, E 607 00:34:55.427 --> 00:34:57.799 we take the first letter of each word 608 00:34:57.799 --> 00:35:00.299 S for scale, R for rotation 609 00:35:00.299 --> 00:35:03.400 T for translation, and 610 00:35:03.400 --> 00:35:08.119 V for view and P for projection 611 00:35:08.119 --> 00:35:14.080 We'll basically have these five transformations 612 00:35:14.080 --> 00:35:16.960 Let's say that we're expressing a character 613 00:35:16.960 --> 00:35:18.910 and the character is composed of 614 00:35:18.910 --> 00:35:20.359 100,000 dots 615 00:35:20.359 --> 00:35:23.719 Then in order to show this character of 100,000 dots 616 00:35:23.719 --> 00:35:28.039 on the screen, I need to go through these five matrices 617 00:35:28.039 --> 00:35:32.679 Then basically, we'll need 500,000 calculations 618 00:35:32.679 --> 00:35:36.440 As you can see here, we need 500,000 calculations 619 00:35:36.440 --> 00:35:40.479 But the transformation itself is always the same 620 00:35:40.479 --> 00:35:45.080 That means we don't need to calculate them separately 621 00:35:45.080 --> 00:35:48.680 We'll multiply the matrices PVTRS 622 00:35:48.680 --> 00:35:52.359 and make it beforehand 623 00:35:52.359 --> 00:35:57.400 Once we create a matrix with the five transformations applied 624 00:35:57.400 --> 00:36:01.719 then all we need to do is apply that matrix for 100,000 dots 625 00:36:01.719 --> 00:36:04.200 and we will get the same result 626 00:36:04.200 --> 00:36:06.350 Therefore, we can decrease 500,000 calculations 627 00:36:06.350 --> 00:36:09.719 to 100,000 calculations 628 00:36:09.719 --> 00:36:12.119 Because of these characteristics of a matrix 629 00:36:12.119 --> 00:36:14.719 computer graphics 630 00:36:14.719 --> 00:36:17.200 especially game graphics that are sensitive to sound 631 00:36:17.200 --> 00:36:21.000 must use matrices 632 00:36:21.000 --> 00:36:24.159 In all the base processes of computer graphic transformations 633 00:36:24.159 --> 00:36:29.159 these formulas and equations of the matrix are used 634 00:36:29.159 --> 00:36:31.760 as what you should know 635 00:36:31.760 --> 00:36:35.479 Until now, we learned about the matrix, why we use the matrix 636 00:36:35.479 --> 00:36:37.679 and the three types of transformation 637 00:36:37.679 --> 00:36:41.312 that we'll often use, and their mechanisms 638 00:36:41.680 --> 00:36:45.462 Inverse matrix 639 00:36:45.919 --> 00:36:50.000 First, inverse matrix corresponds 640 00:36:50.000 --> 00:36:53.479 to the concept of inverse function that we learned before 641 00:36:53.479 --> 00:36:56.379 In the big perspective of linear transformation 642 00:36:56.379 --> 00:36:58.159 matrix is ultimately a concept of function 643 00:36:58.159 --> 00:37:02.159 Therefore, we can say that inverse matrix is also the same concept as an inverse function 644 00:37:02.159 --> 00:37:05.160 Then there's a special function 645 00:37:05.160 --> 00:37:08.400 that always came along with inverse function 646 00:37:08.400 --> 00:37:10.760 That was the identity function 647 00:37:10.760 --> 00:37:15.920 Identity function referred to a function where 648 00:37:15.920 --> 00:37:20.560 the results of the domain and the range correspond to the same value 649 00:37:20.560 --> 00:37:22.910 In the same way as this concept 650 00:37:22.910 --> 00:37:26.439 the identity matrix exists for matrices as well 651 00:37:26.439 --> 00:37:29.479 We'll now learn about how this is composed 652 00:37:29.479 --> 00:37:33.660 An identity matrix ultimately means that 653 00:37:33.660 --> 00:37:37.460 the original space and the transformed space after linear transformation 654 00:37:37.460 --> 00:37:39.880 have the same values 655 00:37:39.880 --> 00:37:45.400 That means, the two standard basis vectors that formed up the original space 656 00:37:45.400 --> 00:37:50.040 have the same values even after transformation 657 00:37:50.040 --> 00:37:54.079 Therefore, when designing an identity matrix 658 00:37:54.079 --> 00:37:57.529 the first column of the first changed standard basis vector 659 00:37:57.529 --> 00:37:59.439 uses the standard basis vector as-is 660 00:37:59.439 --> 00:38:00.800 It uses (1, 0) 661 00:38:00.800 --> 00:38:04.350 And for the second column, (0, 1) is used 662 00:38:04.350 --> 00:38:07.880 to design the identity matrix 663 00:38:07.880 --> 00:38:12.857 Then to see if the results of applying the identity matrix 664 00:38:12.857 --> 00:38:14.520 really has no change 665 00:38:14.520 --> 00:38:17.720 we'll name an arbitrary matrix abcd 666 00:38:17.720 --> 00:38:21.280 When we multiply this identity matrix 667 00:38:21.280 --> 00:38:23.920 we can see that the result value is the same 668 00:38:23.920 --> 00:38:27.880 When we multiply any vector to an identity matrix 669 00:38:27.920 --> 00:38:31.800 an identical vector is made 670 00:38:31.800 --> 00:38:36.760 Therefore, with this special identity matrix 671 00:38:36.760 --> 00:38:42.119 we can add a concept of inverse matrix 672 00:38:42.119 --> 00:38:47.560 It takes the result of a linear transformation, transformed by matrix 673 00:38:47.560 --> 00:38:52.160 and turns it back to the original 674 00:38:52.160 --> 00:38:54.360 It's a linear transformation 675 00:38:54.360 --> 00:38:56.439 that turns back a linear-transformed result 676 00:38:56.439 --> 00:39:00.680 Therefore, when we combine these two, it becomes an identity transformation 677 00:39:00.680 --> 00:39:07.040 Since it created the same value as the original, it is an identity transformation 678 00:39:07.040 --> 00:39:11.640 If you see here, (1, 0) and (0, 1) 679 00:39:11.640 --> 00:39:15.400 of this standard basis vector of the original space 680 00:39:15.400 --> 00:39:19.680 was changed into ac and bd 681 00:39:19.680 --> 00:39:22.800 In order to turn this back to its original 682 00:39:22.800 --> 00:39:27.319 so for the transformation to turn back into A 683 00:39:27.319 --> 00:39:32.760 it is conceptually settled that an inverse matrix of A exists 684 00:39:32.760 --> 00:39:36.860 And the result of combining these two 685 00:39:36.860 --> 00:39:39.479 comes back to the original 686 00:39:39.479 --> 00:39:43.560 Therefore, in the concept of a function, it comes back to identity function 687 00:39:43.560 --> 00:39:48.680 In the concept of matrix, combining inverse matrix and the matrix 688 00:39:48.719 --> 00:39:53.839 becomes the identity matrix 689 00:39:54.680 --> 00:39:58.439 Then how can we calculate this inverse matrix? 690 00:40:01.000 --> 00:40:04.440 It's good to know about the concept of a determinant beforehand 691 00:40:04.440 --> 00:40:08.090 A determinant is 692 00:40:08.090 --> 00:40:10.160 a property of a matrix 693 00:40:10.160 --> 00:40:15.460 Let's say we have a two dimensional square matrix 694 00:40:15.460 --> 00:40:17.280 called abcd 695 00:40:17.280 --> 00:40:20.680 the determinant, which is the property of this matrix 696 00:40:20.680 --> 00:40:24.649 is obtained through the calculation ad-bc 697 00:40:24.649 --> 00:40:29.080 We'll learn about what ad-bc means 698 00:40:29.080 --> 00:40:31.163 Under here, I wrote down 699 00:40:31.163 --> 00:40:35.040 a system of equations 700 00:40:35.040 --> 00:40:39.340 If we say that this system of equations is abcd 701 00:40:39.340 --> 00:40:45.416 and set the x, y, coefficients of 2, 1, 1, 0.5 702 00:40:45.416 --> 00:40:50.766 as abcd, and then when we do 2x0.5 - 1x1 703 00:40:50.766 --> 00:40:52.439 we can see that it becomes 0 704 00:40:52.439 --> 00:40:56.021 I'll explain what happens when the value of ad-bc 705 00:40:56.021 --> 00:40:58.639 becomes 0 like this 706 00:40:58.639 --> 00:41:02.639 If you look here, when we multiply the second equation by 2 707 00:41:02.639 --> 00:41:06.279 it becomes 2x+y=8 708 00:41:06.279 --> 00:41:11.080 Then this system of equations has no solution 709 00:41:11.080 --> 00:41:14.080 This condition of having no solutions 710 00:41:14.080 --> 00:41:17.919 is distinguished through this equation of a determinant 711 00:41:17.919 --> 00:41:22.480 That's why it's called a determinant 712 00:41:22.480 --> 00:41:31.639 It's a value that can analyze and determine something 713 00:41:31.639 --> 00:41:35.139 When we express this system of equations as a matrix 714 00:41:35.139 --> 00:41:38.639 it can be expressed like this 715 00:41:38.639 --> 00:41:41.389 We can use these coefficients 716 00:41:41.389 --> 00:41:44.199 and make it into a matrix like this 717 00:41:44.199 --> 00:41:49.080 In this matrix too, ad-bc would give us 0 718 00:41:49.080 --> 00:41:53.830 Then we'll see what kind of a transformation 719 00:41:53.830 --> 00:41:55.680 this matrix forms 720 00:41:55.680 --> 00:42:00.320 In this matrix, the first standard basis vector transformed to (2, 1) 721 00:42:00.320 --> 00:42:02.720 and the second standard basis vector (0, 1) 722 00:42:02.720 --> 00:42:06.000 has been transformed into (1, 0.5) 723 00:42:06.000 --> 00:42:12.450 When the second vector is multiplied by 2 724 00:42:12.450 --> 00:42:14.080 we get (2, 1) 725 00:42:14.080 --> 00:42:17.839 therefore, they have the same slope 726 00:42:17.839 --> 00:42:21.339 That means, the two vectors (1, 0) and (0, 1) 727 00:42:21.339 --> 00:42:24.536 that were linearly independent 728 00:42:24.536 --> 00:42:28.936 ended up with same slopes through the linear transformation process 729 00:42:28.936 --> 00:42:33.800 and changed into a linearly dependent relationship 730 00:42:33.800 --> 00:42:36.600 The following expresses this as a picture 731 00:42:36.600 --> 00:42:39.600 The vectors with different slopes like this 732 00:42:39.600 --> 00:42:43.039 changed into a space having the same slope 733 00:42:43.039 --> 00:42:46.539 Then here, we were able to create all dots 734 00:42:46.539 --> 00:42:49.119 of the two dimensional space through a linear combination 735 00:42:49.119 --> 00:42:52.169 but here, even when we combine the two vectors 736 00:42:52.169 --> 00:42:54.219 we can only create the dots 737 00:42:54.219 --> 00:42:56.919 on top of this slope 738 00:42:56.919 --> 00:43:02.869 Therefore, a 2D space has been changed into a one-dimensional space 739 00:43:02.869 --> 00:43:06.240 A bad transformation, we could say 740 00:43:06.240 --> 00:43:09.690 Therefore, when this transformation is applied 741 00:43:09.690 --> 00:43:13.759 the result of the linear transformation brought down 2D into 1D 742 00:43:13.759 --> 00:43:16.509 so ultimately, there's no path back 743 00:43:16.509 --> 00:43:20.639 from one-dimension to two-dimension 744 00:43:20.639 --> 00:43:22.939 This means 745 00:43:22.939 --> 00:43:26.160 we cannot make the inverse matrix 746 00:43:26.160 --> 00:43:28.560 Therefore, before obtaining the inverse matrix 747 00:43:28.560 --> 00:43:31.110 we must know the determinant first because 748 00:43:31.110 --> 00:43:34.639 the inverse matrix may or may not exist 749 00:43:34.639 --> 00:43:36.789 How do we determine that? 750 00:43:36.789 --> 00:43:40.789 Use the determinant ad-bc 751 00:43:40.789 --> 00:43:44.804 to first determine whether the inverse matrix exists 752 00:43:44.804 --> 00:43:48.160 or doesn't exist 753 00:43:48.160 --> 00:43:52.110 Then how come the dimension disappears 754 00:43:52.110 --> 00:43:54.559 when the value of ad-bc is 0? 755 00:43:54.559 --> 00:43:59.320 Let's check the area of the parallelogram formed by the two vectors 756 00:43:59.360 --> 00:44:03.160 First, the square formed by the two standard basis vectors 757 00:44:03.160 --> 00:44:06.720 in the original space had an area of 1 758 00:44:06.720 --> 00:44:12.920 But when e1 is transformed into (a, c) 759 00:44:12.920 --> 00:44:16.320 and when e2 is transformed into (b, d) 760 00:44:16.320 --> 00:44:19.920 a parallelogram like this is formed 761 00:44:19.920 --> 00:44:25.370 When we try obtaining the final value here 762 00:44:25.370 --> 00:44:29.040 with the x value of a+b 763 00:44:29.040 --> 00:44:35.000 and y value of c+d, we multiply them to obtain a rectangular area 764 00:44:35.000 --> 00:44:38.750 When we obtain this gray area 765 00:44:38.750 --> 00:44:41.750 by subtracting these triangle and rectangle areas 766 00:44:41.750 --> 00:44:45.640 we get the value ad-bc 767 00:44:45.640 --> 00:44:50.390 That means, ad-bc 768 00:44:50.390 --> 00:44:54.279 is the area of the parallelogram 769 00:44:54.279 --> 00:44:57.229 formed by two linearly independent vectors 770 00:44:57.229 --> 00:45:01.920 as they go through linear transformation 771 00:45:01.920 --> 00:45:05.839 The fact that this is 0, means the area of the parallelogram is 0 772 00:45:05.839 --> 00:45:10.539 Therefore, that means the two vectors 773 00:45:10.539 --> 00:45:14.079 are along the same straight line 774 00:45:15.799 --> 00:45:22.079 With that, we learned about the meaning of a determinant 775 00:45:22.079 --> 00:45:24.829 Then let's say that the value of the determinant is not 0 776 00:45:24.829 --> 00:45:27.720 Then how can we use that? 777 00:45:27.720 --> 00:45:34.070 First of all, the value of ad-bc 778 00:45:34.070 --> 00:45:39.959 is ultimately going from the area of 1, formed by the two standard vectors 779 00:45:39.959 --> 00:45:46.799 to the parallelogram of the form ad-bc 780 00:45:46.799 --> 00:45:51.099 The changed area 781 00:45:51.099 --> 00:45:56.200 the size has been changed by ad-bc 782 00:45:56.200 --> 00:45:58.850 Then how do we turn it back? 783 00:45:58.850 --> 00:46:03.200 We can restore it by multiplying the inverse of the changed size 784 00:46:03.239 --> 00:46:06.289 So the determinant 785 00:46:06.289 --> 00:46:11.160 can simply determine whether there's an inverse matrix 786 00:46:11.160 --> 00:46:15.310 but it can also be used when the space has been changed 787 00:46:15.310 --> 00:46:18.960 to tell how much size change has occurred 788 00:46:18.960 --> 00:46:21.258 after a transformation 789 00:46:25.040 --> 00:46:27.940 Now that we can obtain this inverse matrix 790 00:46:27.940 --> 00:46:31.160 I'll briefly talk about how we can utilize it 791 00:46:31.160 --> 00:46:34.660 Normally, it's useful for 792 00:46:34.660 --> 00:46:39.519 obtaining the solution of a system of equations that we've seen earlier 793 00:46:39.519 --> 00:46:41.919 For obtaining the solution as well 794 00:46:41.919 --> 00:46:45.279 we showed this visually because we use graphics 795 00:46:45.279 --> 00:46:49.079 but like this, we can use matrices very usefully 796 00:46:49.079 --> 00:46:51.000 to obtain the solution 797 00:46:51.000 --> 00:46:55.727 Let's say that this matrix is A, and (x, y) is v 798 00:46:55.727 --> 00:46:59.600 and let's say that the result value is v' 799 00:46:59.600 --> 00:47:02.250 We would get an equation like this 800 00:47:02.250 --> 00:47:06.160 Here, we know v', the result 801 00:47:06.160 --> 00:47:07.810 We know the result and 802 00:47:07.810 --> 00:47:11.060 we also know what transformation we're applying 803 00:47:11.060 --> 00:47:13.710 But let's say that we don't know 804 00:47:13.710 --> 00:47:16.399 what the original value is 805 00:47:16.399 --> 00:47:19.199 Then this is how we solve this 806 00:47:19.199 --> 00:47:23.063 If we obtain the inverse matrix of A and multiply it to both sides 807 00:47:23.063 --> 00:47:27.239 we would do A^-1 times A 808 00:47:27.239 --> 00:47:32.640 and here, we would multiply the transformed v' to A^-1 809 00:47:32.640 --> 00:47:34.840 Then for this value 810 00:47:34.840 --> 00:47:37.740 since the associative property stands here 811 00:47:37.740 --> 00:47:41.200 this eventually becomes the identity matrix I, and we would be left with v 812 00:47:41.200 --> 00:47:44.650 Therefore, if we can obtain the inverse matrix 813 00:47:44.650 --> 00:47:49.600 multiply the inverse matrix on the transformed vector 814 00:47:49.600 --> 00:47:52.200 and we would be able to find the solution 815 00:47:52.200 --> 00:47:55.119 of the original value right away 816 00:47:55.119 --> 00:47:57.669 Just like that, matrix can be useful 817 00:47:57.669 --> 00:48:00.279 for solving equations 818 00:48:00.279 --> 00:48:03.929 It can be used for various, complex problems 819 00:48:03.929 --> 00:48:07.629 Just now, we used it for a very simple form of 820 00:48:07.629 --> 00:48:10.559 system of equations with just two equations 821 00:48:10.559 --> 00:48:13.609 but even with 10 equations or 822 00:48:13.609 --> 00:48:17.119 10 complex coefficients tied together 823 00:48:17.119 --> 00:48:19.219 as long as we know the principle of the matrix 824 00:48:19.219 --> 00:48:23.069 and as long as we have enough samples for each 825 00:48:23.069 --> 00:48:26.119 we can ultimately find the solution 826 00:48:26.119 --> 00:48:28.919 We can use the Gaussian elimination 827 00:48:28.919 --> 00:48:32.719 and the Cramer's rule to obtain the inverse matrix 828 00:48:32.719 --> 00:48:38.069 For the main transformations that we use for graphics 829 00:48:38.069 --> 00:48:42.799 although they would be good to know, you don't really need to know these 830 00:48:42.799 --> 00:48:48.200 That's because we can obtain the inverse matrix intuitively 831 00:48:48.200 --> 00:48:54.039 We'll first look at the scale matrix among the matrices 832 00:48:54.039 --> 00:48:57.589 We'll think about how the inverse matrix 833 00:48:57.589 --> 00:48:59.679 of a scale matrix works 834 00:48:59.679 --> 00:49:05.786 There's a matrix where e1 was increased by a times 835 00:49:05.786 --> 00:49:10.408 and e2 was decreased by b times, from a standard basis vector 836 00:49:10.408 --> 00:49:12.258 In order to make that matrix 837 00:49:12.258 --> 00:49:14.750 come back to (1, 0) and (0, 1) 838 00:49:14.750 --> 00:49:17.440 what should we do? 839 00:49:17.440 --> 00:49:21.280 It's so simple, we just need to decrease by the amount we increased 840 00:49:21.280 --> 00:49:25.630 So if we multiply the inverse of the increased coefficient 841 00:49:25.630 --> 00:49:29.919 it comes back to (1, 0) and (0, 1) 842 00:49:29.919 --> 00:49:33.269 If we multiply the inverse of the increased amount 843 00:49:33.269 --> 00:49:35.119 and make it into a scale matrix 844 00:49:35.119 --> 00:49:38.969 we can say that this becomes the inverse matrix of the scale matrix 845 00:49:38.969 --> 00:49:41.280 that comes back to the original size 846 00:49:41.280 --> 00:49:43.479 We'll also take a look at translation matrix 847 00:49:43.479 --> 00:49:45.200 We translated it 848 00:49:45.200 --> 00:49:52.520 If we only translate on one side, this part increases by a times 849 00:49:52.520 --> 00:49:55.280 Then do should we make it come back to the original? 850 00:49:55.280 --> 00:49:57.599 We would just translate to the opposite direction 851 00:49:57.599 --> 00:49:59.679 Since we just need to push to the opposite side 852 00:49:59.679 --> 00:50:03.919 it would come back to the original if we translate by -a 853 00:50:03.919 --> 00:50:07.679 Therefore, for the inverse matrix of a translation matrix translated by "a" 854 00:50:07.679 --> 00:50:13.960 translating it by "-a" allows us to easily design the inverse matrix 855 00:50:13.960 --> 00:50:19.080 Next, I'll talk about the inverse matrix of a rotation matrix 856 00:50:19.080 --> 00:50:25.039 The first standard basis vector is (cos, sinθ) 857 00:50:25.039 --> 00:50:31.159 and the second standard basis vector is (-sinθ, cosθ) 858 00:50:31.159 --> 00:50:36.000 How can we change this back to the original? 859 00:50:36.000 --> 00:50:40.150 The way of turning it back to its original 860 00:50:40.150 --> 00:50:42.919 is rotating it in the opposite direction by the same amount 861 00:50:42.919 --> 00:50:48.119 In other words, rotating it -θ degrees 862 00:50:48.119 --> 00:50:51.669 If this is a normal rotation 863 00:50:51.669 --> 00:50:54.719 we would substitute -θ degrees into the rotation 864 00:50:54.719 --> 00:50:58.280 Then based on the property of a cos function 865 00:50:58.280 --> 00:51:02.030 where the cos function symmetrical 866 00:51:02.030 --> 00:51:05.440 about the y-axis 867 00:51:05.440 --> 00:51:09.840 -cosθ and cosθ have the same values 868 00:51:09.840 --> 00:51:13.919 Therefore, we can see that the diagonal elements are the same 869 00:51:13.919 --> 00:51:19.799 In the case of a sin function, it's symmetrical 870 00:51:19.799 --> 00:51:21.400 but the sign changes vertically 871 00:51:21.400 --> 00:51:28.880 Therefore, obtaining -sinθ 872 00:51:28.880 --> 00:51:32.320 is the same as sin(-θ) 873 00:51:32.320 --> 00:51:36.840 Ultimately, this goes from negative to positive 874 00:51:36.840 --> 00:51:39.290 and the positive becomes a negative 875 00:51:39.290 --> 00:51:41.679 in this matrix 876 00:51:41.679 --> 00:51:45.479 This is the inverse matrix of a rotation 877 00:51:45.479 --> 00:51:49.919 which turns a rotation matrix back to its original 878 00:51:49.919 --> 00:51:54.269 If we closely examine R_θ and R_(-θ) here 879 00:51:54.269 --> 00:51:57.679 what relationship would they have? 880 00:51:57.679 --> 00:52:00.379 First of all, the value of cosθ is the same 881 00:52:00.379 --> 00:52:04.640 and we can see that only the sinθ values have switched 882 00:52:04.640 --> 00:52:08.919 Therefore, this can also be seen as a transpose relationship 883 00:52:08.919 --> 00:52:14.119 To organize it, a rotation matrix and its inverse matrix 884 00:52:14.119 --> 00:52:17.880 have a transpose relationship with each other 885 00:52:17.880 --> 00:52:20.030 And the inverse matrix of a rotation matrix 886 00:52:20.030 --> 00:52:22.730 is rotation toward the opposite direction 887 00:52:22.730 --> 00:52:26.679 as what we can get from this 888 00:52:26.679 --> 00:52:30.629 With that, we learned about the essential inverse matrices 889 00:52:30.629 --> 00:52:34.840 needed for graphics that we'll perform later 890 00:52:34.840 --> 00:52:37.140 That's all for this lecture 891 00:52:37.140 --> 00:52:38.990 Great job for listening to this lesson 892 00:52:38.990 --> 00:52:39.901 Thank you 893 00:52:40.281 --> 00:52:42.131 Matrix Matrix Numbers arranged inside a rectangle as rows and columns Basic operations of matrix: addition of matrices, multiplication of a matrix... 894 00:52:42.131 --> 00:52:43.881 Characteristics of matrix multiplication Doesn't satisfy the commutative property Satisfies the associative property Satisfies (A·B)^T=B^T·A^T Tran... 895 00:52:43.881 --> 00:52:45.597 Linear transformation and matrix Square matrix is linear transformation where the same dimensional space correspond to each other Column major... 896 00:52:45.597 --> 00:52:46.797 Visualization of linear transformation Linear transformation of the original vector space: [a b] [c d] Using a matrix means tracking the change of... 897 00:52:46.797 --> 00:52:47.997 Scale transformation matrix: [a 0] [0 b] Translation matrix: [1 a] [0 1] 898 00:52:47.997 --> 00:52:49.197 90 degrees clockwise rotation matrix: [ 0 1] [-1 0] 90 degrees counterclockwise rotation matrix: [0 -1] [1 0] 899 00:52:49.197 --> 00:52:50.393 Rotation matrix of an arbitrary θ: [xcosθ - ysinθ] [xsinθ + ycosθ] 900 00:52:50.393 --> 00:52:51.678 Multiplication of matrix Associative property stands Product of square matrix has the same result as composite function 901 00:52:51.678 --> 00:52:52.785 Product of matrix can be used for the addition formula of trigonometric function Matrix operation with a valid associative property guarantees the... 902 00:52:52.785 --> 00:52:54.069 Major linear transformation: Scale(S), Rotation(R), Translation(T), View(V), Projection(P) 903 00:52:54.069 --> 00:52:55.306 When 5 linear transformations are the same, the product of PVTRS can be applied to lessen the number of operations 904 00:52:55.306 --> 00:52:56.157 Inverse matrix Inverse matrix Identity matrix: Matrix with no change in the linear transformation I = [1 0] [0 1] 905 00:52:56.157 --> 00:52:56.957 Inverse matrix: Linear transformation that reverts the linearly transformed result Combining inverse matrix and matrix results in identity matrix H... 906 00:52:56.957 --> 00:52:57.806 Determinant: Expression that determines a condition with no solution A = [a b] [c d], det(A) = ad - bc 907 00:52:57.806 --> 00:52:58.606 Using determinant ad-bc to determine whether the inverse matrix exists Utilizing inverse matrix: useful for solving a system of equations 908 00:52:58.606 --> 00:52:59.456 Inverse matrix of scale matrix: [1/a 0] [0 1/b] Inverse matrix of translation matrix: [1 -a] [0 1] 909 00:52:59.456 --> 00:53:00.306 Inverse matrix of rotation: [ cos(θ) sin(θ)] [-sin(θ) cos(θ)]