### Math Monday: Make a Flake

by Glen Whitney for the National Museum of Mathematics

Today we revive an old snowflake drawing program by Evil Mad Scientist, and realize the designs in a modern meltingly sweet medium. Here’s an updated version of that old program with the trigonometry corrected (cheers for applied math!) so that it will work with any number of sides to your snowflake. The program runs fine in the latest version of Processing; just download and install the development environment, and open the snowflake .pde file. Make sure to enter the number of sides you want your snowflake to have as the value of the variable “sides” on line 25 of the .pde file, overwriting the “6” that appears in the file as distributed. (If any reader would like to modify the program so that you can enter the number of sides in the running program without changing the code, please send the modification to mondays@momath.org and we’ll post it here.) Then fire the program up by hitting the run button in Processing; it will look like this, shown with the number of sides set to seven.

You can drag any of the circular “handles” to alter the outline of the snowflake, and every time you move the middle handle of a segment, more handles appear so that you can make that outline more intricate. The program will automatically replicate your changes throughout the snowflake, keeping it symmetrical with the number of sides selected. It’s ok to cross the outline segments over each other, in which case holes will appear within the snowflake, potentially adding to the interest of the design. Here’s an example of a six-fold design in progress.

When you have reached a symmetric polygon, a.k.a. snowflake, that you like, hit the “Save” button on the snowflake screen to write a pdf file of your design. I also suggest saving a screenshot to catalogue the open and closed areas of the snowflake. For example, here’s the five-fold pattern used for the purposes of this column.

Using this program, three snowflake designs were created for today’s making project: one five-fold, one six-fold, and one seven-fold. The idea is to render these designs as snowflake marshmallow cutouts to decorate festive winter-time drinks. Begin by printing out each design at dimensions just small enough to fit in the top of the cups or glasses you want to use. Then cut carefully around the outlines of the printouts, and select what areas of the snowflakes you want to cut out of the marshmallow snowflakes; carefully slice those portions out. This processes creates paper templates for the snowflakes.

Next you need sheets of marshmallow, available in some craft or specialty food stores. Here’s a sheet, one half inch thick. Line up one of the templates on the marshmallow sheet, and use thumbtacks through the paper and into the marshmallow to hold it in place during the cutting. Then you can begin transferring the design to the marshmallow sheet. I recommend cutting it out with an X-acto or similar craft knife.

Here are some recommendations to make the cutting go more easily: first cut out roughly around the whole snowflake, but fairly close to its outline, because the cleanest cuts come from slicing along a segment of the design’s perimeter all the way out to the edge of the marshmallow slab. Dip the knife blade in vegetable oil to prevent sticking, and keep it well oiled. Keep a damp cloth or paper towel handy to wipe off accumulated marshmallow stuff from the blade from time to time. To cut out interior holes in the pattern, cut around the entire outline of the hole once, go over it again lifting the marshmallow slab up to make sure the blade is going all the way through the marshmallow, and then push the cutout out from the front with the tip of a chopstick. Here’s the seven-fold pattern just before and just after removing the template.

And here are all three different symmetries studied in airy sweetness:

Of course, these geometric snowflakes cry out to serve as adornments for suitably wintry drinks — dark chocolate hot chocolate or eggnog, for example.

Happy New Year from Math Mondays!