#### Sunday, November 21st, 2010...2:43 pm

## Transitions down Diagon Alley

In this entry, the power of matrix operations will transform a youthful Harry Potter to the mature young man seen in the film released just days ago. To begin, we need Harry to enter the matrix, by storing color information of an image in an *n* by *m* matrix where the image is comprised *n* by *m* pixels. For example, the image as seen to the right is 187 by 300 pixels.

Having the image stored as a matrix allows us to use ideas from linear algebra. We will work with entries on the main diagonal of a matrix. If we have a 6 by 6 image, then the main diagonal is easy enough to find as seen in the image below.

We will also work with the *k*-th diagonal below (or above) the main diagonal, where 0 would be the main diagonal. For instance, the image below has orange entries for all matrix elements on the 1-st, 2-nd, 3-rd, 4-th and 5-th diagonals below the main diagonal.

We can also generalize this idea to rectangular matrices, where the number of rows and columns differ. For instance, the image below again has orange entries for all matrix elements on or below the 1-st diagonal below the main diagonal.

We now take the matrix of Harry’s image given at the start of this article and successively change the entries along the *k*-th diagonal. What are the values of the new diagonal? Watch the image and see Harry’s image transition by moving down Diagon Alley.