Animating Mathematics

GIFs aren’t just for cat videos

Clayton Shonkwiler

Colorado State University


this talk!

GIFs? Really?


Yes, really

Spiral Light, by Dave Whyte (@beesandbombs)





My First GIF


A to Z




Spherical Dodecahedron

a.k.a. pentagonal tiling of the sphere

+ Stereographic Projection

= Stereographic Dodecahedron


...of what?

z \mapsto \frac{i (z+1)}{z-1}
zi(z+1)z1z \mapsto \frac{i (z+1)}{z-1}

The Hyperbolic Plane!

Source Code

inv[z_] := I (z + 1)/(z - 1);
circleinversion[z_] := z/Norm[z]^2;

HRot = ParallelTable[
      Flatten[{{10 (t - π), 0}, 
         {ToReal[inv[E^(I t) + #]], 
             circleinversion[E^(I t) + #]]]} & /@ (E^(I θ)*
            Flatten[Table[a + I b, {a, -4, 4, 2}, {b, -4, 4, 2}]], 
            0 + 0 I])}], {t, 0, 2 π}, PlotRange -> 4, 
      Axes -> False, 
      PlotStyle -> 
       Directive[Thickness[.003], RGBColor[{227, 156, 188}/255]], 
      ImageSize -> {540, 540}, 
      Background -> GrayLevel[.2]], 
     {θ, 0., π/2 - #, #}] &[π/400];

Export[NotebookDirectory[] <> "HRot.gif", HRot, 
 "DisplayDurations" -> {1/36}]

And much more mathematics...

Schwarz–Christoffel Mapping

Langer & Singer's Trefoil

Brownian Bridges

Lawson Surface

The Klein Quartic

4-D Rotations

Roman Surface

Polytope Cross-Sections

Pentagon Tilings


The Answer for Most People:



ImageMagick / gifsicle /

Official @beesandbombs

GIF-making guide

The Answer for Me



Only certain pentagons tile the plane

But all quadrilaterals tile!

So I decided to build a quadrilateral tiler...

(requires free Wolfram CDF player)


Last Step: gifsicle

> gifsicle -O2 -k128 input.gif > output.gif


# colors


Download from or install from your favorite package manager

Thank you for listening!

Animating Mathematics

By Clayton Shonkwiler

Animating Mathematics

The animated GIF, which provided flashing lights and rotating "Under Construction" tackiness to the early web, has had an unlikely second life on social media. Aside from serving as a medium for sharing video while ducking the copyright cops, GIFs are embraced by a generation of abstract and geometric artists on Tumblr and elsewhere who have discovered beauty in short, looping animations. My first GIFs were created to sanity-check algorithms and I have since used them in both the classroom and the seminar room, but I also now create mathematical animations that are purely artistic. In this talk I will share some of my GIFs and the (trivial and non-trivial) mathematics behind them. My work is produced in Mathematica with help from a couple command-line tools, so I will also try to impart some hard-earned lessons on how to use this combination to produce GIFs that (probably) won't make you want to claw out your eyeballs.

  • 1,074
Loading comments...

More from Clayton Shonkwiler