I’ll write another post with code to explain this. Hopefully, you can visualise how it works with the diagram. It actually looks much more concise if I can use the summation notation… BUT, I’m trying to simplify things for you. Suppose we multiply matrix A by column vector x and we get a column vector y, the general formula is Yes, the order and the type of vector matters. For our purposes, we are concerned with multiplying a matrix A by a column vector v. Just multiply the scalar with all the entries in the matrix. Let’s multiply matrices by scalars first. The negative sign is “pushed in” to individual entries. Matrix addition (and subtraction)Ī matrix C is said to be the sum of matrices A and B ifĬ = A + B for all i and j. Matrices A and B are said to be equal if every corresponding entry of both matrices are equal. Just go with it a little longer…ĭon’t you think that looks beautiful? *smile* Matrix equality Yes, I know I still haven’t covered matrix multiplication. The inverse of a square matrix A is denoted by A -1, where Rectangular matrices aren’t useful for our purposes in 3D programming, and you’re welcome to research on its practical uses (try “ operations research“). So if A = A T, A is a symmetrical matrix. The transpose of a matrix A is denoted by A T. What you do is simply flip the matrix about its diagonal.
Now that we know what a symmetrical matrix and its diagonal, we can define the transpose of a matrix.
The extra condition leaves out the diagonal and entries below the diagonal. To speed up computations when checking symmetry, some algorithms use What symmetry means in this case is b=d, c=g and f=h. Similarly, if a matrix has zeroes in entries above the diagonal, it’s known as a lower triangular matrix. If a matrix has zeroes in entries below the diagonal, it’s known as an upper triangular matrix. Notation wise, A are the diagonal entries. Where’s the diagonal? Look at this:Įntries a, e and i form the diagonal. Symmetrical matrices are symmetrical about the diagonal. Probably not quite useful to you, but nevertheless, you now know something more. It’s simply a matrix with zeroes in all its entries. You know that multiplication unity described above when defining the identity matrix? Guess what, there’s a number such that when you add anything to it, you get back the same thing. It’s called the identity matrix, typically denoted by an uppercase “I”. There is a matrix such that when you multiply any matrix by it, you get the same original matrix back. In math, there is a number such that when you multiply anything by it, you get back the same thing. In a stroke of coincidence, we will also be focusing on 3 by 3 and 4 by 4 matrices. For example, a 3 by 3 matrix, or a 4 by 4 matrix. This is a special case where both the number of rows and number of columns are equal. The 0 index has tripped many a programmer, so be careful. If your language starts with the 0-th element, make sure to shift positions by one less. So know how your programming language does indices of arrays. Take note, because you'll be using them in code. Typically, we haveġ <= i <= m and 1 <= j <= n, where m is the number of rows and n is the number of columns. Individual entries are referred to with the notation A (or a i,j) where A is the matrix, i is the i-th row and j is the j-th column. It doesn’t matter which one we use when coding, but in terms of notation, we’ll be using column vectors. While we’re at it, a scalar can be thought of as a matrix where the number of rows and columns are both 1.įor our purposes of working towards 3D programming, we’ll be focusing on the column vector. A column vector is a matrix where the number of columns is 1. It’s easier to just show you how they look like.Ī row vector is a matrix where the number of rows is 1. And because of this, we have to define… Row and column vectors So a vector is a special case of a matrix. When either m or n is 1, we get a vector. The dimension of a matrix is m-by-n, where m is the number of rows and n is the number of columns.
Matrices are also known as multidimensional arrays.