In the late autumn, we reach the time of year when it’s dark outside as we sit down to dinner. During those months, we like to have candles lit while we eat. Now, it’s easy enough to blow out the candles at the end of the meal, but that’s somewhat boring too. It also has the unfortunate side effect of spraying drops of wax over the dining room table.

We’ve talked for months about acquiring a snuffer for putting out candles. Over one meal, we even talked about fun snuffer designs that would depart from the canonical “cone at the end of a stick” shape. Based on that conversation, and following a bit of 3D modelling, I came up with the following design, mimicking a marshmallow on a stick.

The snuffer is 3D printed in aluminium. That was the only material offered by Shapeways that’s both heat resistant and feasible for this particular 3D shape. The result is fun, pretty, and comfortable to hold.

And as you can see in this action photo, it works great:

I haven’t played much with 3D printing in a couple of years. My favourite experiments used to be coffee and espresso cups, fabricated using the now-discontinued porcelain process formerly offered by Shapeways. I’m sure that they, or someone else, will start up a new food-safe porcelain process in the future, if the production pipeline can be streamlined. In the meantime, I suppose I’ll be working with plastic and occasional metal.

That’s it for custom-designed 2020 holiday presents. Happy holidays!

]]>For a few years now I’ve been a fan of Redbubble as a place to pick up fun laptop stickers; I’ve created some of my own as well. Earlier this year I noticed that they had added the ability to design custom socks. I knew immediately that I would have to create my own sock designs for my family this year. Everyone opened their gifts this morning, so now’s a good time to share the results of my efforts.

My son is saving up for a fancy gaming rig. At present he can’t afford a top-of-the-line GPU, but he can have the next best thing: top-of-the-line GPU socks. The pattern on the socks is inspired by the AMD Radeon RX 6900 XT, with two exceptions. First, the Radeon has only three fans, but I added a fourth to take up the length of the sock. Second, I added coloured glows because everyone knows that your gaming rig should be filled with gratuitous lighting effects.

My daughter is a connoisseur of cats, memes, and cat memes. In her honour I created socks that depict the most important cat archetypes. They’re a bit hard to see in the photo above; here’s a field guide.

The archetypes are a mixture of doodles, traced photographs, and drawings loosely based on real cats (the smol on the right is our cat Pandora when she was about eight weeks old).

My wife is the real sock expert, a talented knitter who has made many pairs of socks for family and friends. It seemed natural, then, that she should receive socks with a pattern of socks on them. Most of the socks are in styles that one might knit (though there’s a gym sock in there too), and you’ll see that one sock is still on the needles.

These socks were created based on the tastes of my family members, and this post is certainly not intended as an ad, but if you happen to want a pair you can buy them directly from Redbubble by visiting my shop. Happy holidays!

]]>Early in November, Daniel Piker (aka @KangarooPhysics) suggested that a group of people could get together online, and each create a short segment of animation, arranged so that all the start and end frames are identical. We could then assemble all the segments into one long loop and enjoy each others’ work. The idea was based on loops that I had been posting on Twitter for fun, under the hashtag #swirlysquaresunday, and for that reason I called the group project Swirled Series.

Well, wow. I had hoped that maybe I would collect 10–20 submissions, and assemble a short video around a minute long, which could be shared on Twitter. I guess I wasn’t the only one looking for a creative outlet! In all, I received 115 loops from 81 contributors, totalling over six minutes of animation. I am honoured and humbled to serve as the curator of such a fun and diverse collection.

The best way to watch Swirled Series is at the top of this page. The animation is constantly remixing 115 short video clips, playing them in random order. You can also control the speed (I find it looks good slowed down a bit). Finally, I’ve uploaded a video to YouTube, showing the 115 loops in a fixed random order. If you’re on a small device like a phone, and the videos are cut off, you might have better luck with a separate page containing just the viewer.

Of course, none of this would be possible without the tremendous response from an enthusiastic community of creators! Thanks to @C010011012, @CyanidesDuality, @FlyingOctopus0, @GeometryDad, @SlimRunner, @TilingBot, @beesandbombs, @jn3008, @sandvrs, @teadrinker, 落葉子, Zach Abel, Dan Anderson, Dan Bach, Sebestyén Balázs, David Berardo, Daniel Berio, Elijah Bevers, Jim Bumgardner, Dina Buric, Neil Butler, Toby Cathcart Burn, Paul Chaikin, Tim Cieplowski, Tom Edgar, Matt Enlow, Frank Farris, Tony Finch, Lucas Garron, Sam Gates, Pierre Gidel, Andrew Glassner, John Golden, Chris Hanusa, Edmund Harriss, Sam Hartburn, Esther Hecky, Ian Henderson, Matthew Henderson, Jason Hise, Martin Holtham, Chris Johnson, Alex Jones, Roman Karavia, Roni Kaufman, Elliot Kienzle, William Knowles-Kellett, Eryk Kopczyński and Dorota Celińska-Kopczyńska, Tom Lechner, Jose Linares, Colin Liotta, Xing Liu, Nan Ma, Olivier Mercier, Fabrice Neyret, Andrew Osborne, Dave Pagurek, Jon Palin, Vincent Pantaloni, Juan Carlos Ponce Campuzano, David Reimann, Ricky Reusser, Juan Rinaudo, Jesus Rivera, Tanner Rogalsky, Chip Rollinson, Toby Sargeant, Henry Segerman and Saul Schleimer, Tomas Sirgedas, Ben Sparks, Zachary Stein, Tim Straubinger, stuebinm, Rashmi Sunder-Raj, David Swart, Patrick Traynor, Adrian-Teodor Tudorică, Jason Tully, Joachim Wedekind, August Wiklund, and Stasiu Wolanski. (Please tell me if I’ve left your name out or otherwise messed it up—with so many people, there could very well be mistakes!) And special thanks to Daniel Piker for gettting the whole project going.

These submissions constitute a non-trivial dataset, comprising over 18,000 frames and nearly a gigabyte of data. That’s enough information that aggregate measurements of the process become interesting. Here are a few observations.

- People were allowed to submit a loop of up to 180 frames. The average submission was 158 frames, and the majority of submissions were 180 frames—most artists wanted their full 3.6 seconds of fame!
- It would be interesting to categorize the visual and mathematical devices used to create loops. You’ll see fractals, complex numbers, non-Euclidean geometry, aperiodic tilings, physics simulation, 3D animation, strange loops, and all sorts of other sequences. In some ways the project provides an entertaining overview of techniques in mathematical art.
- The first and final frames were required to be identical 8 × 8 checkerboards of black and white squares, in a 512 × 512 PNG image. You’d think that there wouldn’t be a lot of variability in the files for those frames. Ha! Of all the files containing starting frames, the smallest was a meagre 214 bytes (way to go, Lucas Garron!) and the biggest was around 750 KB (what’s up with that, Chris Hanusa?). That’s about a 3000× difference in size, which I suppose says a lot about variation in PNG encoding algorithms.
- Information theory offers interesting measurements here too. To a first approximation, an image that’s visually simpler will be represented by a smaller file (assuming you’re using a good encoder!). Here are 115 superimposed graphs, showing a measurement of the file size of each frame in a loop over its lifetime:

Each graph shows a loop’s frame file sizes as a fraction of the average size for that loop, represented by the black horizontal line (to which all graphs have been normalized). The most obvious trends are that most animations tend to start simple and end simple (naturally, since checkerboards are simple and you’re expected to do something interesting in your loop), and that there’s a noticeable dip in the middle (many loops go through two “phases”, delineated in the middle by a relatively simple pause). I’m left wondering what other measurements I could extract, though it would make sense to re-encode the frames first with a standardized compression algorithm. - This project required a lot of manual labour. First, I maintained a spreadsheet of submissions and collected them manually via email. Then, many submissions contained errors. The most common errors were incorrectly named or numbered files. There were occasional problems with file formats or resolutions. And a lot of people submitted loops that started and ended with a black square in the lower-right corner, where I had asked for a white square. The process would definitely benefit from automated submission and validation!
- Many different tools were used to produce submissions. I’m aware of people using Processing, GeoGebra, Shadertoy, and Desmos, and that’s just for starters.

Based on the enthusiasm of the many contributors, I can certainly imagine doing this again, though perhaps not right away. I would likely restrict submissions to one per person to keep from being inundated. Ideally I would also automate the process of collecting and validating submissions.

This was a fun experience, thanks again to all the contributors!

]]>Earlier today, Daniel Piker suggested that it would be fun for a group of people interested in these looping mathematical animations to collaborate. Each would contribute a short sequence that begins and ends with a checkerboard, and we’d glue them together into one longer animation. What a lovely idea! The most famous example of this variety of collaborative artwork is what the Surrealists called an Exquisite Corpse. Exquisite Corpse *animations* are popular too; I’ve long been a fan of The Zoomquilt, and I’ve seen it done as a group project in animation courses.

So, let’s create a Swirled Series!

If you’re reading this, you’re invited to submit a short animation loop. I’ll stitch them together into a final sequence. Let me lay down some rules in order to keep the process sane:

- Use a resolution of 512×512.
- No colour, but it’s OK to use grey levels beyond pure black and pure white.
- Your segment should have at most 180 frames (I’ll aim to play back at 50 frames per second). It’s OK to have fewer frames.
- Your segment should begin and end with the same frame: an 8×8 checkerboard (i.e., squares of dimension 64×64), with white in the lower-right corner.
- You can do anything you want to get from a checkerboard back to a checkerboard, except sit still.
- I strongly recommend that your loop have “zero derivative” at the first and last frames; that is, it should glide to a graceful stop, so that the transition to the next animation in the sequence isn’t jarring.
- I would prefer to receive your submission in the form of a zip file containing a directory of PNG images named
`frame000.png`

,`frame001.png`

, …`frame179.png`

. - You grant me a non-exclusive, irrevocable license to use your images non-commercially, in animations, for education and research. Conceivably, if the result is entertaining, I might submit it to, say, the Bridges Short Film festival. In all cases, contributors will receive appropriate credit.
- The deadline is
**Friday, November 27th**. I’ll aim to publish the result the following week.

To contribute, send your zipfile to me at `swirledseries@gmail.com`

, or send me a link where I can download it.

In the unlikely event that this becomes popular, it’s possible I’ll receive more submissions than I know what to do with. In that case, please accept my apologies in advance as I work out some sort of compromise. I may have to choose who gets in by lottery or submission order, and impose a limit of one submission per person. Most likely, I’d simply keep doing this and roll extra submissions into future animations.

Thanks for playing with us!

]]>Early in the course I introduce Boolean values and conditional evaluation (we use the language Racket in this course, and teach the special form `cond`

here; other languages might use an `if`

statement). As a case study of using `cond`

, I explore speeding fines. Here’s the problem setup:

If you’re caught driving over the speed limit on Ontario highways, you might be punished with a fine. The precise amount of the fine depends on how fast you were driving. As of 2019, the penalty structure was as follows:

Amount by which you exceeded the speed limit |
Amount you pay |

Less than 20 km/h | $3.00 per km/h over the speed limit |

At least 20 km/h but less than 30 km/h | $4.50 per km/h over the speed limit |

At least 30 km/h but less than 50 km/h | $7.00 per km/h over the speed limit |

At least 50 km/h | $9.75 per km/h over the speed limit. |

(Highway Traffic Act, 1990)

Let’s turn this into a function `speeding-fine`

that consumes a speed in km/h and produces the corresponding fine.

The lesson goes on to present the solution, which looks like this:

(define (speeding-fine speed) (cond [(< speed 100) 0] [(and (>= speed 100) (< speed 120)) (* 3.00 (- speed 100))] [(and (>= speed 120) (< speed 130)) (* 4.50 (- speed 100))] [(and (>= speed 130) (< speed 150)) (* 7.00 (- speed 100))] [(>= speed 150) (* 9.75 (- speed 100))]))

If Racket isn’t your cup of tea, don’t worry about it too much. The important part of the function definition is the line `[(< speed 100) 0]`

, which translates to “if your speed was less than 100 km/h, you pay a fine of zero dollars”.

On the discussion boards, a student made this observation in response:

It’s just a technicality since the math works out either way, but the first condition should be

`[(<= speed 100) 0]`

rather than`[(< speed 100) 0]`

because there is no fine for driving exactly at the speed limit. All the subsequent iterations of the example have the same issue.

In other words, driving at precisely 100 km/h should count as “not speeding”, whereas I counted it as “speeding” (by omitting it from the first condition). The choice of `<`

vs. `<=`

doesn’t affect the result of the computation, but there’s a philosophical question here. What do you think? Did I make a mistake?

In fact, I thought about this quite a bit when writing this lesson, so I had a comically long answer for the student. I created this post to share that response. (I was particularly pleased to be able to incorporate recent current events by suddenly pivoting to an unexpected connection. It’s a rhetorical device that I definitely borrowed from the blog of my old friend Eric Lippert.)

Hi, author of the course here. I’m *delighted* that you raised this point. I went back and forth several times over the choice of `<`

vs. `<=`

in that example. I think it’s actually a very subtle question, and I could probably write a 5000-word essay about it. I won’t! But let me try to explain my choice.

**Note to students: this is beyond anything you need to care about. As the poster notes, this is a technicality, because it doesn’t affect the behaviour of the function (why not?). So feel free to ignore this and complete Module 02 without thinking about it.**

The main reason I went with `<`

is for consistency with the other conditions. The law definitely says, e.g., “less than 20 km/h” to define a tier for the fine structure, so we know we’ll need a `<`

in the second and all subsequent cases. I thought the code would look simpler with a `<`

for the speed limit too, and I had the luxury of making that choice because it doesn’t matter mathematically (whereas it *does* matter at the higher tiers).

But there’s a subtler mathematical point here. What *is* speed? In particular, is it a continuous or discrete quantity? There’s only one person qualified to answer this question: the rapper Kanye West.

Earlier this year, Yeezy announced that he was running for President of the US. It was only later that he realized that you can’t just *say* that and have it be true—there are forms to fill out, signatures to gather, etc. You have to get on the ballot in every state. He tried to get on the ballot in Wisconsin, which had a filing deadline of 5:00pm on August 4th. He submitted the forms 14 seconds after the stroke of 5:00pm, and was told that the deadline had passed. Predictably, his lawyers sent a 23-page complaint to the election commission, arguing that the entire minute of 5:00pm technically counts as On Time, because the law doesn’t talk about seconds. (See this article for more.)

So, what *is* a deadline? Is it a finite interval of time, like “the minute of 5:00pm”? Or is it an instantaneous transition from “on time” to “late”? And what’s a speed limit? Is it a continuous range of speeds, say [100,101) km/h, or is it the infinitesimal transition from less than 100 to more than 100? If it’s instantaneous, what would it mean to file your paperwork at *exactly* 5:00pm, or to travel at *exactly* 100 km/h? The, uh, good news is that it’s physically impossible to do either; or rather, the laws of physics don’t permit us to measure time or speed accurately enough to know that you’re doing that. Given enough digits of precision, every clock and radar gun will put you either before the threshold or after it, never on it.

I doubt any of this has ever been tested in court (but I would *love* to see that happen). The real world just isn’t set up to make these kinds of distinctions, and thank goodness. We avoid these transitional areas—you might get pulled over for going 10 km/h over the speed limit, but probably not for going 0.1 km/h over the speed limit (I hope you can afford the $0.30 ticket). And so, from a surprisingly deep philosophical perspective, I didn’t sweat the difference between `<`

and `<=`

too much in writing the function, because it can’t possibly matter.

By the way, watch for this point to arise again in the course, in Lesson 04.7. There, I make a metaphor with Racket sports, and the question of whether “on the line” is in or out.

Have a good weekend!

]]>I’m freshly back from a weekend in Toronto, where I was participating in the Winter meeting of the Canadian Mathematical Society. I don’t normally attend math conferences, but this time around I was invited to a session entitled “The Art of Mathematics”, and it seemed natural to join in. As it happens, the session was mostly about using art in the context of mathematics *education*; my research, which uses math to make new art, was something of an outlier. Nevertheless, I saw lots of terrific ideas for deploying art in the mathematics classroom, and snuck into a second session on increasing diversity, something both math and CS desperately need.

I spoke about “Mathematical Animated GIFs”, an art form I’ve been tracking online for at least a few years now. I focused exclusively on artworks, setting aside both animated diagrams and memes. I made my own contribution to the genre at Bridges this year, with a paper on animated tilings; I plan to summarize that work and showcase the results in a separate post. Here I’ll offer a list of the artists, artworks, and visual devices I showed in my talk, in case anybody would like to review them and discover more.

I’d love to spend lots of time discussing the many artistic merits of the people mentioned below, but I’ll take a just-the-facts approach and list them. For each artist I showed two representative works.

**David Whyte, AKA beesandbombs**(www.instagram.com/davebeesbombs/)

I showed cylinders and wavy square (my names for them).**Paolo Ceric, AKA patakk**(patakk.tumblr.com/)

I showed twisty triangle and tube (my names).**Matthew DiVito, AKA mrdiv**(mrdiv.tumblr.com/)

I showed cage and diamond_lines.**David Szakaly, AKA davidope**(dvdp.tumblr.com)

I showed 140104 and 130207.**Charlie Deck, AKA bigblueboo**(bigblueboo.tumblr.com/)

I showed cube spiral and cube chasers.**A few of mine**

I showed some of my past experiments: concentric waves, Gingham Vortex II, and a hypocycloid juggling pattern.

Here are additional pointers to artists and their GIFs, which I’m adding to this post as they are suggested to me. Check back later for more!

- Matt Enlow offered a pointer to his work in the comments below.
- Andrew Glassner created many lovely animations using Processing. A lot of these are demonstrations for his online introductory programming course.

In my talk, I offered some thoughts on the toolkit of visual devices that these artists rely on in order to create looping animations. These devices are important, because a loop that’s too simple might come across as more “obvious” or less artistic. For each device, I showed two examples.

**There and back again:**Evolve outward to some point, then reverse what you did so you return to a point where you can close the loop. I showed polygons by Rob Cramer and 190622 by davidope.**Closed parameter loop:**Construct a design that lives in a space controlled by a small number of parameters. Then move through a closed, continuous path in that space of parameters. I showed 190725 by davidope and Fabergé Fluctuation by Tom Beddard (AKA subblue).**Figure/ground duality:**Break a loop into multiple “chapters”, where in each chapter a different subset of the elements in the design plays the role of foreground and animates over top of the remaining elements. Beesandbombs is surely the master of this form; I showed discs/squares and heptominoes.**2D/3D interplay:**Some artworks explore designs based on three-dimensional geometry, but which take on a strongly 2D interpretation from a specific viewpoint. That 2D interpretation is often “brittle”, in the sense that it can be used as a junction point in the animation to move to other 3D forms. I showed negative cube by bigblueboo and spincubes by beesandbombs.**Strange loops:**I borrow Hofstadter’s terminology in describing a loop that doesn’t return to its starting point, but to a new configuration that happens to be indistinguishable from it, like the impossible staircase in Escher’s Ascending and Descending. The result is usually paradoxical and highly compelling. I showed subversion by bigblueboo and scaling squares by beesandbombs.

I talked a little bit about introductory techniques for making your own mathematical animated GIFs. The easiest software I’ve found for this task is Processing. Processing is a self-contained programming environment that streamlines the sorts of animated drawing tasks that you’ll need for abstract GIF art.

In older versions of Processing, there was a library for exporting animated GIFs. Sadly, that library doesn’t seem to be compatible with Processing 3, at least not without extra work. Therefore I suggest you export a sequence of frames from Processing as static images (say, in PNG format) and then stitch them into a GIF using ImageMagick. On my Mac, that means opening a terminal window, going into the directory where I’ve saved all the image files, and using a command like

`convert -delay 2 -loop 0 *.png output.gif`

Sorry if that’s brief; this post isn’t intended to serve as a complete tutorial. I did give a quick live demonstration during the talk, culminating in a creating a GIF that I tweeted on the spot.

I hope you’ll follow the links above and learn more about this hypnotic art form. The lists above are not meant to be exhaustive or rigorous, just the results of my random wanderings. A more systematic study of artists and devices would make for an excellent interdisciplinary art/CS project. You might start by looking through the posts on Colossal tagged with “GIF”. In the meantime, I encourage you to comment with links to other mathematical GIF artists I may have missed (I’d be especially happy to have more gender diversity).

]]>**WARNING: ****It seems as if there may be a problem with the rendering engine that will cause severe flickering on some devices. If you have a seizure disorder or are otherwise sensitive to flickering, please don’t start the game. Sorry about that.**

If you’d actually like to play it, I hope the controls are simple enough:

- Left and right arrow keys to move the current block around the well.
- Up and down arrow keys to rotate the current block.
- Space bar to drop.
- P to pause.

You might need to click in the game window in order to get it to recognize your keystrokes.

Because of the extreme perspective, I expect the game is largely unplayable (though playing Tetris without being able to read the well is an interesting experience, akin to blindfold chess). If you really wish to get through it (the perspective zoom at the end of the level, inspired by Tempest, is pretty badass), press the D key to activate a more conventional Tetris visualization in an overlay.

There’s not much more to say about this experiment. The whole thing is written in P5.js, with the vector display simulation operating as WebGL shaders. The game doesn’t add much to the Tetris (or Tempest) genre, though I haven’t seen a Tetris variant in which the well can be a cylinder, and that turns out to be somewhat interesting. I love musical mashups, so it’s satisfying to contemplate game mashups as well.

Thanks for playing!

]]>Late last year I met Brian Poindexter through a mutual friend from graduate school. Poindexter was part of a team that had been selected to create a large-scale art installation at Burning Man 2019. They were designing a pavilion that would be clad in wooden screens featuring Islamic geometric patterns. Poindexter saw some of my work in this area, and recruited me to create the geometric designs for the screens.

The pavilion as a whole went through several iterations over the next six months or so. By May it had settled down into a five-sided pyramidal tower with decorative fins. My “canvas” would be five large trapezoids (the pyramid was actually a frustum—it was to have a small opening at the top). One of the faces would have an arched passage at its base; the others would have oval windows.

The team sent me CAD files for the sides of the pyramid, which was all I needed to start drawing prototypes. I explored three main ideas for the design; here, I’ve got the luxury of showing you the two designs that we rejected, together with the one we eventually picked.

Zellij refers to a style of Islamic geometric patterns found in Morocco, based on assemblies of tightly fitting glazed terracotta tiles. The shapes of most of the tiles are related to the Seal of Solomon, an eight-pointed star formed from two overlapping squares. Designs often feature a large central star with as many as 96 points, with constellations of smaller stars radiating out from the centre.

I learned most of what I know about this style of design from Jean-Marc Castera’s books. Castera’s explanation of Zellij factors a pattern into a high-level “skeleton” that delineates large regions, and a few standard patterns of tiles that are then used to fill in those regions. This approach is convenient for my oddly shaped canvas—I had some freedom to choose a skeleton that put interesting features in eye-catching places. Above, a 16-pointed star hovers over the portal, surrounded by a hatched Seal of Solomon (reminding me just a bit of the Eye of Providence). Two more 16-pointed stars flank the portal near the ground.

In the end, this design was too busy. It might also have proven too difficult to manufacture, as this level of detail may not have been reliably cuttable from sheets of plywood.

In a second approach, I imagined the trapezoid extended to a complete isosceles triangle, and calculated that the angle at the peak of that triangle would be around 26.9 degrees. That’s somewhere between 360/13 and 360/14. Hypothetically, then, it might be possible to fill the trapezoid with a design based on 13- or 14-fold rotational symmetry. A “wedge” taken out of such a design could be stretched to fit the trapezoid exactly, with lines of reflection symmetry running along the edges of the pyramid—mathematically, a very elegant idea! The hopefully imperceptible stretching even tickles my interest in near-misses.

Now, 13- and 14-fold geometry are quite rare (though not unheard of) in historical Islamic art, so there wasn’t a lot of precedent from which to draw. Fortunately, there’s some lovely contemporary work on the subject to serve as inspiration. In 2012, Jay Bonner and Marc Pelletier published a two-part paper (Part 1, Part 2) on systems for 7-fold Islamic patterns; Jay later published a lot of this material in his comprehensive book on the subject (to which I contributed a chapter). As it happens, the second of their papers had exactly the design I needed as a prototype: a pattern with 14-fold symmetry, from which I extracted a slice that I fit to the panel shape above.

Mathematically, this design works quite well; as you can see in the drawing, the sides of the trapezoid are lines of reflection of the original design. However, the team decided that it didn’t work as well *aesthetically*, which in the end takes precedence.

In the end, we ended up using a variation of one of the first patterns I proposed, really just as an initial example for testing. The design is a excerpt from a repeating pattern of 8- and 16-pointed stars, adapted directly from one of the most famous Islamic geometric patterns in history, found for example in the Alhambra in Spain:

Interestingly, this pattern straddles the design traditions of the two rejected prototypes above. Its structure can mostly be accounted for through a kind of “polygons-in-contact” technique advocated by Jay Bonner, which he used for his 14-pointed design, but some of it definitely borrows from the Moroccan Zellij tradition. This is also, by the way, one of the patterns that M.C. Escher (and his wife Jetta) drew in sketchbooks while visiting the Alhambra, and which profoundly inspired his quest to create “regular divisions of the plane” from figurative animal forms.

After fine-tuning the placement of the design relative to the structure of the pavilion, and stealing the hatching from the Zellij prototype, the team in California decided to move forward with this plan.

At this point (around July), Poindexter et al. went more-or-less incommunicado, as they worked on the serious challenges of actually manufacturing parts that could be hauled out to the playa and assembled. Indeed, I heard so little over the next couple of months that I didn’t even know if they had succeeded! Happily, after the dust had settled (har har) on Burning Man 2019, we reconnected and I finally got to see the results of our work.

The results are quite lovely! Many great photos of the installation can be found online, for example at DesignBoom and Dezeen. There’s an official website for the project, which will hopefully also be updated soon with a post-Burning Man report.

I didn’t know a lot about the inspiration for the project while I was working on it. Later I learned that it had been envisioned by the prominent architect John Marx, while Poindexter and many others formed the “Playa Muses”, who put the work together and brought it to Burning Man. The project as a whole was intended as an homage to heroic women and female empowerment, which makes me even happier to have participated.

Without ever having been to Burning Man myself, I hope I have managed to make a small contribution to its mythology, as part of an artwork that explores decidedly mythological themes.

]]>The artist M.C. Escher drew many lovely tilings, which he called “regular divisions of the plane”. He worked hard to ensure that his tilings were of lifelike animal forms such as birds and fish. He filled notebooks with hand-drawn sketches of tilings, many of which later found their way into his woodcuts. If you’d like a detailed account of these notebooks and their mathematical connections, I recommend Doris Schattschneider’s book *Visions of Symmetry*; A Google image search is also a quick way to see a lot of the drawings.

One of Escher’s lifelong obsessions was the representation of infinity in a finite work of art. He experimented with several ideas for fitting infinitely many tiles into a drawing, culminating in his famous Circle Limit prints based on hyperbolic geometry. But that’s a story for another day. Before that, he drew a number of tilings where tiles form rings or spirals that diminish towards a point at the centre of the drawing. I call your attention in particular to Fish, Path of Life I, Path of Life III, and Development II. His remarkable final print Snakes executes a cunning transition from a hyperbolic tiling near the edge of a disc to a spiral tiling near the centre. Since then, others have created similar drawings. For example, you’ll see a few in a gallery of images by Jos Leys.

Naturally, mathematicians and computer scientists have worked on techniques for creating new tilings in this style. For example, you can see some abstract spirals emerging in a Bridges paper by Robert Fathauer. It seems to me that there has been an uptick in this sort of work recently—I have been sent a few different scholarly manuscripts on spiral tilings to review for journals. However, these manuscripts go through painful contortions to attempt to express the construction of these tilings in awkward, unnatural ways. It turns out that there’s a beautiful and exceedingly simple idea for turning ordinary planar Escher tilings into spiral tilings, an idea I’d like to share here for anyone interested in pursuing research on this topic. It’s an old idea too—I include it in Section 5.3 of my 2002 PhD dissertation, and I certainly don’t claim to have invented it (more on this later).

Most of the rest of this post will explain the math needed to create spiral tilings. You’ll need to be familiar with some geometry, trigonometry, and the complex numbers. Even if you don’t want to work through the math, be sure to scroll down to the bottom: at the end, I’ll introduce a fun web-based tool I created to let you play around with these tilings yourself!

We’ll start with the exponential function . Here is Euler’s number, approximately 2.71828. The function is standard in modelling situations with rapid growth, like populations of organisms or compound interest.

We can extend the domain of the exponential function to the entire complex plane using standard laws for exponents together with Euler’s formula (Euler has a lot of things named after him!). For a given complex number , we end up with

In other words, thinking for a moment in terms of regular Cartesian coordinates, a point will get mapped to a new point , which can also be thought of (via polar coordinates) as a point at distance from the origin, making a counterclockwise angle of with the axis. Note that the and functions repeat with a period of ; therefore, a vertical column of points spaced out by multiples of , like fenceposts seen from above, will all get mapped to the same point by the exponential function. In practice, we might as well factor out this repetition: we can draw pictures by starting with a single horizontal slice of the complex plane of height , and mapping its contents through . What will that look like? We can start to get a handle on how images distort by looking at what happens to straight lines:

The picture on the left shows a square portion of our horizontal slice of the plane of height , which becomes the picture on the right after mapping through the complex exponential. Let’s consider each of the lines shown on the left.

- Sticking with Cartesian coordinates, the green vertical line consists of points of the form for all values of . These get mapped to points of the form on the right. Or, letting , we end up with the set of points for all . In other words, a circle centred on the origin, as shown.
- On the other hand, the orange horizontal line has a varying and a fixed , giving . The range of the real exponential function is all positive real numbers, so the image of the horizontal line is a radial line extending out from the origin at angle . In our drawing the image of the orange line looks a bit like an infinite “wedge”; that happens because I’m mapping the full thickness of the line, and that thickness gets crammed into a tighter space closer to the origin.
- General diagonal lines don’t map to simple shapes like lines or circles. It turns out that they become logarithmic spirals, where the slope of the line determines the pitch of the spiral. Logarithmic spirals arise frequently in nature (the Wikipedia page linked here gives some examples).
**Public Service Announcement:**the so-called*golden spiral*is a logarithmic spiral whose pitch is related to the golden ratio. But not every logarithmic spiral is golden, and*nature doesn’t favour golden spirals*. You’ll often see the claim that nautilus shells are related to the golden ratio, but there’s simply no connection; they do grow (approximately) logarithmically, but there’s nothing forcing them to become golden spirals.

Notice also that although this mapping distorts space quite a bit, it does preserve *angles*: the angle at which two curves cross on the right is the same as the angle between the two original lines on the left. Such mappings are called *conformal*.

Already we can start to see how patterns of lines that repeat in the plane can be turned into interesting spiral patterns:

In general, as long as the top and bottom edges of the drawing on the left match up seamlessly, the exponential map will turn it into a seamless spiral drawing on the right. The effect is a bit like rolling the horizontal slice up into a tube and then looking down the length of the tube (but not really: things don’t shrink in perspective quite as they do with our mapping here). Looked at another way, if you have a pattern that repeats over the whole plane in some direction, you can rotate and scale the pattern so that the repetition is vertical and has length . Then we know that the edges of the slice will line up.

My introduction to the mapping of patterns through the complex exponential function came from the 1992 paper “Two Conformal Mappings” by Robert Dixon, which I also cited in my dissertation. Dixon gave it the more evocative name “the antiMercator mapping”.

A tiling of the plane is called *periodic* if there are vectors (i.e., arrows) in two distinct directions along which you can slide the tiling and have it match up with itself exactly when you’re done. For example, if your tiling is an infinite square grid, you can slide it horizontally or vertically by the edge length of a single square, and the tiling will look the same. We can even exploit this fact to make a animated GIF that loops forever:

These vectors are called *translational symmetries* of the tiling. The nice thing about symmetries is that if you perform several of them in sequence, the result must be a symmetry as well. In this case, if you have a set of vectors that are all translational symmetries, the sum of those vectors is also a symmetry.

To sprinkle in a bit of notation, let’s say you’ve got a periodic tiling, and let and be two translational symmetries of that tiling, as described above. (We’ll want to assume they’re not parallel, though that’s not strictly required.) Let and be two integers, not both zero. Then the new vector is a translational symmetry of the tiling.

OK, then, here’s the punchline: we can rotate and scale the whole tiling so that the vector is vertical and has length . That puts the tiling into a configuration where the top and bottom edges of our canonical horizontal stripe line up, meaning that we’ll get a seamless drawing under the complex exponential map!

We now have a recipe that we can apply starting from any periodic tiling together with integers and . Let’s look at some examples based on a humble tiling of squares. Unlike the previous diagrams, I’m zooming out a bit to show some of the tiling above and below the slice. The slice itself is bounded by the dashed horizontal lines. You can see that in each case I’m taking a different sum of horizontal and vertical square edges as my primary vertical repeat vector. The whole tiling is then oriented so that this sum of the two green vectors is vertical and has length . Something quite nice happens here. Consider the tiling, for example. As you walk along any vertical line in the slice, you’ll pass three grid lines parallel to and seven lines parallel to . This fact is reflected in the spiral tiling: if you look carefully, you can see three spirals of tiles in one direction and seven in another! The colourings below allow you to count them up. The pattern holds in general: a spiral square tiling based on will exhibit spiral arms in one direction and in the other.

Of course, there’s nothing here that restricts you to squares. Any periodic tiling of the plane can be combined with integers and and mapped into one of these spiral arrangements. Here are just a couple of examples; can you figure out the tiling and the values of and that were used to produce them? Note that I’m restricting myself here to simple geometric tilings, but this technique would work exactly the same on fancy Escher-like tilings with varying colours, internal details, and other artistic devices.

As I said, the idea of using the complex exponential function (AKA the antiMercator mapping) to produce drawings like these is far from new. The specific application to periodic tilings shown here isn’t new either, given that it appears in my dissertation from (gulp) more than 15 years ago. I don’t know of an earlier source for this small novelty, but I absolutely don’t think I came up with it myself. In fact, I believe it may have been the great tiling theorist Branko Grünbaum who pointed it out to me in person. I had the good fortune to interact with him while I was working on my PhD, and everything I’ve shown you here would have been immediately obvious to him.

I have one more trick up my sleeve. We can pass the spiral tiling through a different function of the complex plane called a *Möbius transformation*, a function of the form

These are beautiful and fascinating functions. I don’t want to get too deep into their mathematical properties here, so I’ll say intuitively that a Möbius transformation can *exchange a point at infinity with another point*. If I pass a tiling through one of these transformations, I can grab infinitely many tiles that are arbitrarily far away and pack them into a point that looks like the centres of the spirals you’ve already seen. Better yet, I can keep the spiral centre I’ve already got, giving me a picture with two infinities! Here are two examples, one based on squares and one based on hexagons.

Again, this isn’t a new idea. Escher experimented with it in his print Whirlpools, and others such as Jos Leys have created similar designs.

By the way, it’s very tempting to try to repeat this trick and drag a *third* infinity into the picture. Sadly, that simply doesn’t work. Can you see why?

If you’ve read this far (or even if you haven’t), now you have a chance to play with all of these ideas yourself.

Last year I released Tactile, a library for C++ and Javascript that makes it easy to write programs to manipulate and draw tilings. Part of my motivation in creating the library was that it would then be easier for me to write quick pieces of software to demonstrate or exploit ideas from tiling theory. And that’s what I’ve done here! I wrote a fun web-based editing tool that lets you draw tilings and experiment with transforming them into spirals. Tactile is based on *isohedral *tilings; happily, these are all periodic, and so they’re perfect for experimentation in spiral form.

**Click here to launch the tool in a new window**. It’s written to be usable from a touch device like a tablet (though I wouldn’t expect it to be usable on a small phone), but it will work fine with a mouse too. The many features deserve some elaboration. I explain the different controls below, using this annotated screen shot as a guide.

- There are four buttons. The “Fullscreen” button makes the spiral tiling take up the whole window. You can return to the full interface by tapping the button again. The “Animate” button moves the untransformed tiling automatically, making the spiral mapping rotate and scale. The “Help!” button brings you to this post (in case you found the tool without reading this post first). The “Save” button downloads the spiral tiling from your browser.
- This view lets you edit the shape of a single tile. Tap on a black edge to create a new vertex and drag it around. Long-press on a vertex to delete it. The grey vertices cannot be moved directly.
- Controls for the structure of the tiling. The top slider lets you choose a tiling type. There are 81 types encompassing triangles, squares, hexagons, and other base shapes. Each type uses a different number of additional sliders to control the arrangement of grey vertices on the left. Moving those sliders will change the overall configuration of the vertices.
- These two sliders are precisely the values of and discussed above, controlling the vector that will be mapped to cover the horizontal slice. You can actually set them both to zero; the program won’t crash, but it won’t draw anything.
- The regular Euclidean tiling. You can translate the tiling around by clicking and dragging, and see the effect on the spiral view. Horizontal and vertical translation map to uniform scaling and rotation, respectively.
- A view of the resulting spiral tiling. Tap on the view to switch between a regular antiMercator mapping with one infinity, and a Möbius transformed picture with two infinities.

The combination of the complex exponential function and suitable transformations of periodic tilings offers a vast playground for creating beautiful and fun spiral tilings.

Wow, this post ended up longer than I had planned. I hope the diagrams and pretty pictures helped it go down smoothly! For my part, this post and the accompanying software were at least in part a distraction from an upcoming grant deadline. Thanks for validating my brief escape from professional duties.

]]>Now, I do not have sufficient expertise in most of the science behind this work to unpack the whole article here; you might instead read the summary that appeared in *Nature*‘s “News and Views” section. My contribution relates to a few words that the journal chopped off of the end of the title due to space constraints. The original title read “…reversible assembly *and paradoxical geometry*“. The phrase “paradoxical geometry” refers to near-miss Johnson solids, a topic that I’ve studied for a long time; the “protein cage” referred to in the title is, from my point of view, a near miss realized at molecular scale (a fact that is mentioned only in passing in the News and Views summary). I helped to explain the geometry of the cage, and to some extent measure just how paradoxical it is. Here I will give a bit of background on this topic, leading up to a geometric view of the cage’s structure.

The five Platonic solids, the thirteen Archimedean solids, and the prisms and antiprisms are convex polyhedra with regular polygons as faces. But they’re not the only polyhedra with this property. For example, you can imagine a square-based pyramid that’s just tall enough that its triangular sides are equilateral. In 1966, Norman Johnson identified 92 additional convex polyhedra with regular faces, starting with the square-based pyramid; today these are known as the Johnson solids. They’re a motley crew of geometric oddities, which look as if they were assembled out of leftover parts from the Archimedeans.

In 2001, George Hart and I published a paper about polyhedra in which we included a brief mention of “near misses”: convex polyhedra with faces that are almost—but not quite—regular. We did not attempt to define near misses rigorously, merely saying that the angles were close enough that you could assemble a model from cut-out regular polygons “without noticing the discrepancy”. The paper offered these three examples:

The second and third polyhedra are easily exposed as Johnson solid impostors, by identifying vertices that could not exist in a Johnson solid. For example, the second polyhedron has a vertex surrounded by two hexagons and two triangles. A regular hexagon has an interior angle of 120°, and an equilateral triangle has an interior angle of 60°. So, if those faces were all regular, the angles around the vertex would be 60° + 60° + 120° + 120° = 360°. But that’s impossible! When you pack that much angle around a vertex, you force the faces there to lie flat, contradicting our assumption that this polyhedron is convex. The polyhedron on the left is not so easily dismissed. You need to grind through some trigonometry to prove that if the enneagons (9-sided polygons) and squares are regular, then the triangular faces are slightly isosceles and not really equilateral (I get an angle of about 63.1° at the triangle vertex nestled between two enneagons).

I’ve written about near misses elsewhere, including a 2016 post about a new one I had constructed. In 2017, Evelyn Lamb wrote a wonderful article about the more general phenomenon of near misses in mathematics, leading off with near-miss Johnson solids. She also had the good fortune to interview Norman Johnson, who noted that he stumbled on near misses while enumerating his solids, but cared about them only to the extent that he had to eliminate them from his list. Sadly, Johnson passed away shortly after the article was published.

Around the time that we wrote that 2001 paper, I found another interesting near miss, one that didn’t fit with the techniques in the paper. To construct it, start with the pentagonal icositetrahedron (PI), the dual of the more familiar (and Archimedean) snub cube. This solid is made from 24 identical shield-shape pentagonal faces:

Let’s focus on a single shield, as in the shape on the left below:

We can imagine slicing through each of the four upper corners of the shield, as suggested by the four dashed lines. If we do this correctly, the corners are truncated to create new edges that have the same length as the leftover bits of the original shape. The pointy bottom of the shield still sticks out, but by coincidence we can just about fit two more short edges into the point, as shown in the middle. The right drawing shows that these lines define a shape that bears an uncanny resemblance to a regular hendecagon (i.e., a regular 11-sided polygon).

Looked at another way, if we take a perfectly regular hendecagon and fit it by eye to the shield, we can achieve an amazingly good fit. In the diagram below, I’ve lined up the midpoints of the top edges of a shield and a regular hendecagon, and manually scaled the latter until it straddles the edges of the former. The close-up shows just how tight the fit is. You can just barely see the hendecagonal edge tilted relative to the shield edge.

As a final demonstration of the closeness of the fit, let’s compare angles in the shield and the hendecagon:

The angle *α* on the left is a property of the PI, and measures around 114.8°. The angle *β* on the right is exactly 180°⨉(7/11), or around… 114.5°. Again, an amazing coincidence, one that makes it possible to inscribe the hendecagon almost perfectly within the shield.

To complete the construction of a near miss, we can simply glue together regular hendecagons in the same pattern as the shields in the PI. The holes around the tops of shields can easily be filled with equilateral triangles, and the holes around the pointy corners of shields can be filled with clusters of four triangles around a square. Here’s the result:

The paper model on the right is actually easiest to construct, because you can let the laws of physics absorb and distribute the mathematical error inherent in the construction. To build a computer model, you must make explicit decisions about where that error should go. For example, the faces could be made slightly irregular, or slightly non-planar.

Again, I have no rigorous test for near-miss-ness that I could apply to this solid. But intuitively, the miss is very near indeed, and the paper model can easily be constructed without noticing the error.

As an aside, my goal at the time was to create interesting tilings of the sphere to serve as a scaffolding for drawing spherical Islamic geometric patterns. I eventually created a few 3D designs based on the techniques in the paper, and on the hendecagonal near miss. I then turned these models into 3D printed sculptures.

However, I didn’t have much else to say on the mathematics of near misses, so I put the shape on a short web page and left it at that.

Fast forward to late 2013. A team of biochemists had been working with a custom-engineered protein ring called TRAP, which they knew had 11-fold rotational symmetry. They observed that under suitable encouragement from gold nanoparticles, a set of TRAP rings would assemble into a round solid form, which they called a TRAP Cage. But the structure of this cage was something of a mystery, because they didn’t know of a simple geometric form made from pieces with 11-fold symmetry. I assume they searched the web for polyhedra with hendecagonal faces, because they eventually found me by chance. And sure enough, it looked like the TRAP rings in their cage were arranged like the hendecagons in my near miss!

I joined the collaboration, with the aim of building a computational model of the TRAP Cage, from which we could measure the likelihood that the cage could hold itself together based on the distribution of error in the model.

The TRAP Cage is a bit more flexible than the near miss. First, it is constructed purely from TRAP rings, so we don’t have to worry about fitting squares and triangles into the model. Second, the rings aren’t actually attached directly to each other as they would be in a polyhedron; instead, the ring has 11 tiny arms that stick out, and arms from neighbouring rings grab on to gold atoms to hold the structure together. This extra flexibility means that we can likely construct a model cage with even lower error than the original near miss.

I tested this hypothesis using numerical optimization, searching for a symmetric arrangement of TRAP rings for which the gold bonds would have the correct lengths predicted by chemical considerations. The goal of the optimization was to minimize the worst error in bond length, while also trying to keep the arrangement of TRAP rings as round as possible.

This optimization was easily able to find virtual cages where the bond lengths between neighbouring rings never deviated by more than *one part in a billion* from their ideal lengths. That’s an astonishing degree of nearness for a near miss. I’m not a physicist, so I can’t say exactly how near, but allow me to speculate. I’ve got to assume that this deviation is well within the chemical tolerances for atomic bonds, meaning that the TRAP Cage would hold together without ever running afoul of its own mathematical impossibility. Going further, I note that the ideal bond length was given to me with just two significant digits, suggesting that an error of one part in a billion is much smaller than our uncertainty in measuring the “true” bond length in the first place. In other words, we may as well round the error to zero in the messy real world.

The TRAP Cage is, then, a real-world near miss at molecular scale: you could build it out of regular microscopic pieces without, as I said earlier, “noticing the discrepancy”.

The article appeared in the May 16th issue of *Nature*. Even if you’re not a subscriber, they have provided a link that will allow you to read the full article. I tried to use my meagre 3D modelling skills to create a flashy image for the issue’s cover, but it didn’t pass muster. Of course, my blog is the perfect place to display the image.

I’m incredibly excited to see this curious corner of geometry find a real-world application. Perhaps this discovery will motivate me or others to establish a more rigorous theory of near misses. Indeed, Agnieszka Kowalczyk, a mathematics PhD student at Jagiellonian University, together with Bernard Piette from Durham University, are already researching other cage structures with “paradoxical geometry” and have found numerous examples (aided by the fact that these cages don’t need to be fully watertight like polyhedra). They force their polygons to join edge-to-edge but permit them to deform slightly away from regularity, and then work on measuring and minimizing that deformation. They’ll be presenting some of their initial findings at this year’s Bridges conference in Linz. I’m looking forward to seeing what else we can do with this work.

]]>