April 2020
Intermediate to advanced
380 pages
9h 24m
English
Let's say we wish to rotate the image in our example by 90 degrees. If we examine the first row of pixels from the top after the rotation, we would expect that the first two pixels of the row would be purple, the middle six would be red, and the last two would be yellow. In the analogy of rotation of matrices, this might be seen as a transpose operation wherein the rows are converted to columns and vice versa. The image then looks like this:

And, as expected, the first row of pixels is represented by the following matrix:
[[255, 0, 255],[255, 0, 255],[255, 0, 0],[255, 0, 0],[255, 0, 0],[255, 0, 0],[255, 0, 0],[255, 0, 0],[255, 255, ...
Read now
Unlock full access