Imagine yourself in an electronics store, buying a new camera. The store assistant says, "This is a great camera, it has a 16-megapixel matrix", and you are frantically trying to remember what the word "matrix" means. Let's figure it out.
The matrix of a 16 MP digital camera is a rectangular array of 4928 by 3264 photosensors, each representing a pixel. If you multiply these numbers, you will get 16,084,992 (about 16 million) pixels.
In fact, if you are really into cameras, you should know that the number of pixels is not the only thing that matters; their physical size is also important. A matrix with bigger pixels produces a better quality image.
Structure and representation of a matrix
Okay, so you have bought that camera, and the information about your purchase has appeared in the accounting table of the store like this:
| July | August | September |
Canon | 8 | 21 | 9 |
Nikon | 5 | 2 | 11 |
Sony | 12 | 4 | 11 |
Olympus | 2 | 15 | 4 |
This table, as well as the matrix with pixels, can be represented as a matrix (plural: matrices):
In general, a matrix is a rectangular array of elements arranged in rows and columns. The elements can be numbers, symbols, or expressions. Below we will talk about numerical elements.
Matrix dimension
The number of rows and columns defines the dimension of a matrix.
For example, matrix has 4 rows and 3 columns, so the dimension of matrix A is 4 3 (read "four by three").
Note: The number of rows is followed by the number of columns.
More generally, an matrix has rows and columns:
Vectors
Recall that if a matrix has only one row or one column , such matrices are called vectors (row vector or column vector). For example, the coordinates of a point K in the three-dimensional space is a matrix "one by three".
Matrix elements
Each element has its own position in the matrix. In matrix A, an element in row and column is represented by . In our electronics shop example, element tells us that the Canon cameras were purchased 21 times in August (check the table above).
The order of elements in the matrix is important. Imagine what would happen with our world if point and point occupied the same place?
In computer graphics, matrices are used in operations such as translations, rotations, scaling, and more. These concepts are relevant to video game graphics. Understanding matrices is a basic necessity for programming 3D video games. Also, the matrix which we mention above is real: computers can process photos precisely because the images are presented as matrices.
Conclusion
Congratulations! In this topic, we have introduced the notion of a matrix, here are some of the main take-aways:
Matrix is a rectangular array of elements that conduct the same type of information and are stored in rows and columns
If a matrix is dimensional then it has rows and columns
Vectors are a special case of matrices, they just have 1 column or 1 row
Order of elements in matrices matters, as two matrices with the same elements, but in different order are not equivalent