{"id":36,"date":"2013-11-08T15:46:23","date_gmt":"2013-11-08T15:46:23","guid":{"rendered":"\/\/3dbym.ru\/2013\/11\/scalar-multiplication\/"},"modified":"2013-11-08T15:46:23","modified_gmt":"2013-11-08T15:46:23","slug":"scalar-multiplication","status":"publish","type":"post","link":"https:\/\/3dbym.ru\/2013\/11\/scalar-multiplication\/","title":{"rendered":"Scalar Multiplication"},"content":{"rendered":"
There are two types of matrix multiplication: matrix times matrix and matrix times scalar. Before you get into multiplying matrices by other matrices, you should perform scalar multiplication because it is much easier. A scalar is simply a number such as 10, 3, or 13,142. Multiplying or dividing a matrix by a scalar is quite easy. As always, you start with the matrix and a scalar value. All you need to do to multiply the whole matrix by your scalar is take each element, multiply it by the scalar, and place it in the resulting matrix. The same principle applies for scalar division. This operation is illustrated in Figure 1.5. A good use of this technique again goes back to the example used in the addition and subtraction section.<\/p>\n
Say your group of units takes a wrong turn and plows across a pit full of radioactive slime. This radioactive slime has the special property of removing half of the health from each unit in the group. Using scalar multiplication or division, you can perform this operation in one shot. Simply multiply the hitpoints matrix by 0.5 or divide it by 2.<\/p>\n
\n ~3<\/p>\n<\/td>\n | \n 5<\/p>\n<\/td>\n | \n o"<\/p>\n<\/td>\n | \n<\/td>\n | \n 3×4<\/p>\n<\/td>\n | \n 5×4<\/p>\n<\/td>\n | \n 0x4<\/p>\n<\/td>\n | \n<\/td>\n | \n 12<\/p>\n<\/td>\n | \n 20<\/p>\n<\/td>\n | \n o’<\/p>\n<\/td>\n<\/tr>\n | |
\n 4<\/p>\n<\/td>\n | \n 4<\/p>\n<\/td>\n | \n 8<\/p>\n<\/td>\n | \n<\/td>\n | \n 4×4<\/p>\n<\/td>\n | \n 4×4<\/p>\n<\/td>\n | \n 8×4<\/p>\n<\/td>\n | \n =<\/p>\n<\/td>\n | \n 16<\/p>\n<\/td>\n | \n 16<\/p>\n<\/td>\n | \n 32<\/p>\n<\/td>\n<\/tr>\n | |
\n 9<\/p>\n<\/td>\n | \n 6<\/p>\n<\/td>\n | \n 1<\/p>\n<\/td>\n | \n<\/td>\n | \n 9×4<\/p>\n<\/td>\n | \n 6×4<\/p>\n<\/td>\n | \n 1×4<\/p>\n<\/td>\n | \n<\/td>\n | \n 36<\/p>\n<\/td>\n | \n 24<\/p>\n<\/td>\n | \n 4<\/p>\n<\/td>\n<\/tr>\n<\/table>\n
|