Digital Art II: End of Week 4

It’s hard to believe it’s been four weeks already!  Recall that we ended Week 2 with work on an Evaporation piece.  We’ll see examples of student work after a brief recap of Weeks 3 and 4 (Days 6–10).

In the past two weeks, we focused on affine transformations and their use in creating fractals with iterated function systems.  This was not intended to be a deep discussion of linear algebra, but a practical one — how affine transformations reflect the geomtetry of fractal images.

Fractal beetle created with an iterated function system.

Days 6 and 7 were an introduction to the geometry of affine transformations.  I like to emphasize the geometry first, so I worked to find a way to simply and unambiguously describe an affine transformation geometrically.


The blue square represents the unit square, and the red parallelogram the transformed square.  The filled-in/open black circles on the parallelogram represent how (0,0) and (1,0) are transformed, respectively.  Additionally, the pink fill in the parallelogram represents that fact that there is a flip (that is, the determinant of the linear part of the transformation is negative).  Strictly speaking, this coloring isn’t necessary, but I think it helps.

We then worked on writing the affine transformation in the form


We did this in the usual way, where the columns of the matrix represent where the unit basis vectors are transformed, and the vector added at the end is the translation from the origin.  These can all be read from the diagram, so that the picture above describes the affine transformation


To help in visualizing this in general, I also wrote a Sage worksheet which produces diagrams like the above picture given the parameters af.  In addition, I showed how the vertices of the parallelogram may be found algebraically by using the transformation itself, so this meant we could look at affine transformations geometrically and algebraically, as well as with the Sage worksheet.   (Recall that all worksheets/assignments may be found on the corresponding day on the course website.  In addition, I have included the LaTeX code for the assignments for those interested.)

I explained several different types of affine transformations — translations, reflections, scalings, and shears.  On Day 8, we saw how to write the affine transformations which describe the Sierpinski triangle, and students got to play with creating their own fractals using the accompanying Sage worksheet.

On Day 9, I took about half the class to go through three of my blog posts on iterated function systems.  I emphasized the first spiral fractal discussed on Day035, paying particular attention to the rotation involved and matrix multiplication.


Most students weren’t familiar with trigonometry (recall the course has no prerequisites), so I just told them the formula for rotation matrices.  We briefly discussed matrix multiplication as function composition.  I gave them homework which involved some practice with the algebra of matrix multiplication.

On Day 10, we began with going over some previous homework, and then looked at what transformations were needed to producing the fractal below (as practice for their upcoming homework).


We then engaged in the following laboratory exercise:  Create a fractal using two affine transformations.  For the first, rotate by 45 degrees, then scale the x by 0.6 and the y by 0.4, and finally move to the right 1.  For the second transformation, rotate 90 degrees clockwise, and then move up 1.

This was practice in going from a geometrical description to a fractal — they needed to perform the appropriate calculations, and then enter the data in the Sage worksheet and see if their fractal was correct (I gave them a link to the final image).

This turned out to be very challenging, as they were just getting familiar with rotations and matrix multiplication.  So we’ll need to finish during the next class.  I’ll also give them another similar lab exercise during the next class to make sure they’ve got it.

Last week’s digital art assignment was another success!  Again, I was very pleased with how creative my students were.  If you look back at the Sage worksheets, you’ll see that the class was working with color, texture, and color gradients (like my Evaporation piece).

One student created a texture with a lot of movement by keeping the circles separate and using a wide range of gray tones.


Maddie took advantage of the fact that the algorithm draws the circles in a particular order to create a scalloped texture.  This happens when the circles are particularly large, since the circles are drawn in a linear fashion, creating successive overlap.


Another student also used this overlapping feature with a color gradient.  He describes his piece as follows:

This piece is what I like to call “The Hedge” as it reminds me a lot of those tall square hedges that are in mansions. It’s as if the light is hitting the top of the hedge and dispersing down into the shadows and thickness of the leaves. I especially like the leafy effect the overlapping circles give.


Finally, Madison experimented with altering the dimensions of the grid to create a different feel.


She thought that making the image wider made the evaporation effect more pronounced.

These are just some examples of how students in my Mathematics and Digital Art course take ideas I give them and make them their own.  They are always asking how they can incorporate one effect or another into their work, and Nick and I are glad to oblige by helping out with a little code.

As I strive to keep my posts a consistent length, I won’t be able to share all the images I’d like to this week.  So I’ll be posting additional images on my Twitter feed, @cre8math.  Follow along if you’d like to see more!

Digital Art I: End of Week 2

Mathematics and Digital Art is well underway!  As promised, I’ll be giving weekly or biweekly summaries of how things are going.  You’re also welcome to follow along on the course website.

Day 1 was the usual introductory class, with a discussion about the syllabus and what the course would be like.  (Remember I blogged a four-part series on the course beginning at Day045.)  I wanted to make it clear that there would be both mathematics and coding in the course.  Some students ended up dropping the course the first week as a result, leaving the class with nine students.

On Day 2, I discussed representing color on the computer — using RGB values (both integer and real), as well as using hexadecimal notation.  Since the course has no prerequisites, we really did need to start at the beginning.  Students did some exploring with various RGB values using a Sage worksheet.  (Links to all the worksheets and other websites referenced in class can be found on the course website.)

Josef Albers was the topic of Day 3.  I’ve talked a lot about his work before, so I won’t go into great detail here.  I let students try out a Sage worksheet — they had an assignment to create their own version which was due in about week, so we spent half the class starting the project.


Essentially, they needed to choose a color scheme and size for their piece.  But then they needed to use five different random number seeds, and decide which of the five resulting images looked best to them, and why.  So the assignment included a brief narrative as well.  The complete prompt is on my website.  (And I think I’ll just stop saying this — just know that anything I mention in these posts will be discussed in more detail on the course website.)

The next two classes focused on creating a piece based on Evaporation.


Again, I discussed this in some detail before (Day011 and Day012).  The basic idea is to use randomness to create texture, both with color and geometry.  Add to this the idea of a color gradient, and that’s enough to get started.

I took a bit of time on Day 5 to explain in some detail about how to create color gradients using a function like y=x^p, where p>0 — it isn’t exactly obvious if you’ve never done it before.  Having Nick as my TA in the class really helped out — I was at the board, and he was at the computer drawing graphs of functions and varying the parameters in the routine to produce color gradients. We worked well together.

It turns out that having two of us in the computer lab is really great — debugging takes time.  Students are gradually getting accustomed to the Sage environment, and  learning to go back and redefine functions if they get an error message indicating that something is undefined….

I have really been enjoying the laboratory experience!  My students are wonderfully creative, taking the basic motifs in directions I hadn’t considered.  I’ll illustrate with a few examples from the first assignment.  In this post and future posts, all work is presented with the permisson of the student, including the use of his/her name if applicable.

I should also remark that my intent is not merely to post pieces I subjectively like.  True to the title of my blog, Creativity in Mathematics, I intend to illustrate creative, original ideas.  I may feel that some students have been more successful with their ideas than others — but I’ll share that with the students individually rather than discuss it here.

In order to talk about the students’ creativity, however, let me show you the image they started with.sample

Andrew experimented with minimalism, creating a series of 2 x 2 images.  This is the one he said he liked the best because of the symmetry and contrast.


Julia was interested in exploring different geometries and created a few drafts which deviated from the rectangle-within-rectangle motif.  Here is one of them.


Safina took a slightly different approach.  She wanted to create some variation by using trapezoids in the centers of the larger rectangles.


Ella really worked with the geometry, creating a lot of visual contrast — especially with the asymmetrical polygons.


So we’re off to a great beginning!  Right now, Nick and I are having to help a lot with editing code since it’s a new experience for most students.  But they are eager to learn, and as you can see, willing to explore new ideas, going well beyond where they started.  We can look forward to a lot more interesting work as the semester progresses!

P.S.  If you are ever interested in any of the students’ work and would like to discuss it further, send an email to and I’ll forward it on to them!