## 100 Posts!

Can you believe it?  I have been waiting to be able to finally tag “Day1xx”, and that day is finally here!

I could say something momentous on this occasion.  But I’m not sure that’s really necessary — you can imagine that keeping a blog running for 100 weeks with (hopefully!) interesting posts on mathematics, creativity, and art is momentous emough.

But I have been running into a problem:  my blog is getting harder to search.  For example, I just got five pages of results by searching for “fractal”!  So I thought I’d put together an index of all my blog posts, organized by category.

I hope this is of use to newer followers — you might like certain topics better than others, and this way you can easily look at older posts related to the ones you like.

The category a post is listed under is what I consider its primary category — but rarely does a single post only address on topic.  But surely this index is a step in the right direction.

And lastly, I would like to thank all my followers for encouraging to keep me going.  I get an email every time someone likes or comments — and I appreciate each one. Thanks again!

A.  Introduction

1. Day001, What Is Mathematics?

B.  Mathematical and Digital Art

1. Day002, Josef Albers and Interaction of Color.
2. Day011, Evaporation I.
3. Day012, Evaporation II.
4. Day015, Geometrical Dissections II: Four to One.
5. Day022, Envelopes III:  Art and Randomness
6. Day029, The Joy of Ink I.
7. Day030, The Joy of Ink II.
8. Day054, Color I: Opacity and Josef Albers.
9. Day055, Color II: Opacity and Josef Albers.

C.  Mathematical Puzzles

1. Day003, CrossNumber Puzzles.
2. Day005, Cryptarithms.
3. Day010, ColorSlide Puzzles.
4. Day018, Roman Numeral Puzzles.
5. Day024, Logic Puzzles I.
6. Day025, Logic Puzzles II.
7. Day031, Number Searches I.
8. Day032, Number Searches II.
9. Day109, Beguiling Games I:  Nic-Nac-No.
10. Day114, Beguiling Games II:  Nuh-Uh!
11. Day119, Beguiling Games III:  Splotch!
12. Day122, Knights and Rogues.
13. Day125, Beguiling Games IV:  Scruffle.
14. Day132, More CrossNumber Puzzles.

D.  Two-Dimensional Geometry

1. Day004, Hexominoes and Cube Nets.
2. Day014, Geometrical Dissections I.
3. Day020, Envelopes I.
4. Day021, Envelopes II:  Making Spirals.
5. Day074, The Ravioli Equation.
6. Day106, Polygons.
7. Day118, Geometrical Dissections III:  Octagons and Dodecagons.

E.  Pedagogy

1. Day006, Day163 (reprise), The Problem with Calculus Textbooks.
2. Day013, Writing Original Problems.
3. Day023Day093 (reprise), The Problem with Grades.
4. Day026, On Grading.
5. Day028, International Dodecahedron Day 2016!
6. Day158, Teaching Three-Dimensional Geometry, I.
7. Day160, Teaching Three-Dimensional Geometry, II.
8. Day161, Teaching Three-Dimensional Geometry, III.
9. Day164, On Assessment, I.
10. Day165, On Assessment, II.
11. Day166, On Assessment, III.
12. Day167, On Assessment, IV.
13. Day168, On Assessment, V.

F.  Koch Curves and Related Topics

1. Day007, Creating Fractals.
2. Day008, Creating Fractals II: Recursion vs. Iteration.
3. Day009, Creating Fractals III: Making Your Own.
4. Day027, Creating Fractals IV:  Results!
5. Day033, New Koch Snowflakes.
6. Day062, Koch Curves and Canopies.
7. Day065, p-adic Numbers I: When Big is Small.
8. Day067, p-adic Numbers II: When Big is Small.

G.  Essays

1. Day016, On Mathematical Creativity I.
2. Day017, On Mathematical Creativity II.
3. Day019, Writing a Math Blog.

H.  Iterated Function Systems

1. Day034, Creating Fractals V:  Iterated Function Systems I.
2. Day035, Creating Fractals VI:  Iterated Function Systems II.
3. Day036, Creating Fractals VII:  Iterated Function Systems III.

I.  Programming and Coding

1. Day037, Creating Fractals VIII:  PostScript Programming.
2. Day058, On Coding I.
3. Day060, On Coding II: LISP.
4. Day064, On Coding III: LISP to Mathematica.
5. Day068, On Coding IV: Mathematica.
6. Day075, On Coding V: Postscript.
7. Day078, On Coding VI: HTML.
8. Day082, On Coding VII: LaTeX I.
9. Day085, On Coding VIII: LaTeX II.
10. Day092, On Coding IX: Computer Graphics I.
11. Day099, On Coding X: Computer Graphics II.
12. Day107, On Coding XI: Computer Graphics III, POV-Ray.
13. Day117, On Coding XII:  Python.
14. Day121, On Coding XIII:  Retrospective.

J.  Mathematics and Art Conferences

1. Day038, Bridges:  Mathematics and Art I.
2. Day049, Bridges:  Mathematics and Art II.
3. Day050, Vienna!  (Symmetry Conference 2016).
4. Day053, Bridges: Mathematics and Art III. Jyvaskyla, Finland!
5. Day083, Art Exhibition: Golden Section 2017.
6. Day105, Bridges 2017 in Waterloo, Canada!
7. Day134, Art Exhibition: Golden Section 2018.
8. Day169, Jagodina, Serbia:  2018.

K.  Processing

1. Day039, Making Movies with Processing I.
2. Day040, Making Movies with Processing II.
3. Day041, Making Movies with Processing III.
4. Day042, Making Movies with Processing IV.
5. Day043, Making Movies with Processing V.
6. Day044, Making Movies with Processing VI.
7. Day108, To Processing I.
8. Day110, Using Processing for the First Time.
9. Day113, Creating Animated GIFs in Processing.

L.  Mathematics and Digital Art Course

1. Day045, Mathematics and Digital Art I.
2. Day046, Mathematics and Digital Art II.
3. Day047, Mathematics and Digital Art III.
4. Day048, Mathematics and Digital Art IV.
5. Day057, Digital Art I: End of Week 2 (Fall 2016).
6. Day059, Digital Art II: End of Week 4 (Fall 2016).
7. Day061, Digital Art III: End of Week 6 (Fall 2016).
8. Day063, Digital Art IV: End of Week 8 (Fall 2016).
9. Day066, Digital Art V: End of Week 11 (Fall 2016).
10. Day069, Digital Art VI: End of Week 14 (Fall 2016).
11. Day071, Digital Art VII: Final Projects! (Fall 2016).
12. Day072, Digital Art VIII: The End (Fall 2016).
13. Day081, Mathematics and Digital Art: Update 1 (Spring 2017).
14. Day086, Mathematics and Digital Art: Update 2 (Spring 2017).
15. Day090, Mathematics and Digital Art: Update 3 (Spring 2017).
16. Day094, Mathematics and Digital Art: Final Update (Spring 2017).
17. Day112, Mathematics and Digital Art: Update 1 (Fall 2017).
18. Day115, Mathematics and Digital Art: Update 2 (Fall 2017).
19. Day123, Mathematics and Digital Art: Final Update (Fall 2017).

M.  Guest Bloggers

1. Day051, Guest Blogger:  Geoffrey Owen Miller, I.
2. Day052, Guest Blogger:  Geoffrey Owen Miller, II.
3. Day096, Guest Blogger: Percival Q. Plumtwiddle, I.
4. Day097, Guest Blogger: Percival Q. Plumtwiddle, II.
5. Day154, Transforming Mathematics Education:  BAMAS, X.
6. Day155, Guest Blogger:  Scott Kim, II.
7. Day156, Guest Blogger:  Scott Kim, III.
8. Day157, Guest Blogger:  Scott Kim, IV.

N.  Milestones

1. Day056, Celebrating One Year!

O.  Imagifractalous!

1. Day070, Imagifractalous! 1: How it all began.
2. Day073, Imagifractalous! 2: p-adic sequences.
3. Day077, Imagifractalous! 3: Fractal Binary Trees.
4. Day087, Imagifractalous! 4: Fractal Binary Trees II.
5. Day088, Imagifractalous! 5: Fractal Binary Trees III.
6. Day089, Imagifractalous! 6: Imagifractalous!
7. Day103, Imagifractalous! 7: Fractal Binary Trees IV.

P.  What is a Geometry?

1. Day076, What is a Geometry?
2. Day079, What is…Taxicab Geometry?
3. Day084, What is…Spherical Geometry?
4. Day091, What is…Inversive Geometry?
5. Day095, More on: What is…Inversive Geometry?
6. Day101, What is…Projective Geometry?
7. Day102, More on:  What is…Projective Geometry?
8. Day104, Still more on:  What is…Inversive Geometry?
9. Day152, What is….A Polygon?

Q.  Miscellaneous Mathematics

1. Day080, A New Cantor Set?
2. Day098, The One Four Conjecture.
3. Day147, Pythagorean Triples.
4. Day153, Circle Geometry.

R.  Bay Area Mathematical Artists

1. Day111, Bay Area Mathematical Artists, I.
2. Day116, Bay Area Mathematical Artists, II.
3. Day120, Bay Area Mathematical Artists, III.
4. Day124, Bay Area Mathematical Artists, IV.
5. Day131, Bay Area Mathematical Artists, V.
6. Day135, Bay Area Mathematical Artists, VI.
7. Day140, Bay Area Mathematical Artists, VII.
8. Day144, Bay Area Mathematical Artists, VIII.
9. Day149, Still Moving On (and BAMAS IX)….
10. Day154, Transforming Mathematics Education:  BAMAS, X.
11. Day159, Bay Area Mathematical Artists Seminars, XI.

S.  In Memory of Fr. Magnus J. Wenninger, O.S.B.

1. Day 126, Fr. Magnus Wenninger, O.S.B, I.
2. Day 127, Fr. Magnus Wenninger, O.S.B, II.
3. Day 128, Fr. Magnus Wenninger, O.S.B, III.
4. Day 129, Fr. Magnus Wenninger, O.S.B, IV.
5. Day 130, Fr. Magnus Wenninger, O.S.B, V.

T.  The Puzzle Archives.

1. Day133, The Puzzle Archives, I.
2. Day136, The Puzzle Archives, II.

U.  Calculus

1. Day006, The Problem with Calculus Textbooks.
2. Day137, The Geometry of Polynomials.
3. Day138, Calculus:  Linear Approximations, I.
4. Day139, Calculus:  Linear Approximations, II.
5. Day141, Calculus:  The Geometry of Polynomials, II.
6. Day142, Calculus:  Hyperbolic Trigonometry, I.
7. Day143, Calculus:  Hyperbolic Trigonometry, II.
8. Day145, Calculus:  Hyperbolic Trigonometry, III.
9. Day146, Calculus:  Hyperbolic Trigonometry, IV.
10. Day150, Calculus VII:  Approximations.  [Not sure how the numbering got off….]
11. Day151, Calculus VIII:  Miscellaneous Problems, I.

V.  Truly Miscellaneous….

1. Day148, Moving Out and Moving On….
2. Day149, Still Moving On (and BAMAS IX)….

W.  Polyhedra

1. Day162, Enumerating the Platonic Solids.
2. Day174, My Polyhedra Textbook, I.
3. Day175, My Polyhedra Textbook, II.

X.  Four-Dimensional Geometry

1. Day170, The Fourth Dimension, I.
2. Day171, The Fourth Dimension, II.
3. Day172, The Fourth Dimension, III.
4. Day173, The Fourth Dimension, IV.

## Celebrating One Year!

It’s hard to believe, but I published my first blog post one year ago today on September 1, 2015.  It’s been a challenge at times to keep up the weekly posts — but I’m very glad I did.  So here I write, fifty-five posts later….

I do wish to thank my followers and email subscribers, but I’ll stop there at sentimentality.  Given the occasion, I thought I’d talk about one important aspect of the art of mathematics that I’ve hinted at now and then.  Mathematics is a team effort.

Sure, sometimes I have to sit at my desk and just do mathematics.  But there’s a lot more to mathematical endeavor than that.  So I’d like to discuss some conversations I’ve had over the past year — conversations which helped me formulate new ideas and forge new directions to pursue.  Places I wouldn’t have gone if all I did was sit at my desk….

Some of my earlier posts were a direct result of doing some independent study work with one of my students, Thomas.

We were talking about the usual recursive algorithm to create the Koch snowflake, and he asked what would happen if we changed the angles used in the algorithm.  This prompted a year-long investigation into properties of images created using the algorithm — especially images with rotational symmetry.

I gave talks about this phenomenon in Vienna and Finland.  I also mentioned discussing this with one of the conference attendees in Vienna — Paul — who said the images in my talk reminded him of some work he had done earlier.  This image is generated using Paul’s algorithm.

When I looked at his paper, I found that he had used a different recursive algorithm — but surprisingly, the images had a similar feel to those I created.  I haven’t had time to explore this alternate algorithm yet, but if I hadn’t been talking to another artist and mathematician, I might never have come across it.

My last two posts were the direct result of attending a talk at the Bridges conference in Finland.  I had posted about Josef Albers before, but James gave a talk which looked at Albers’ Homage to the Square series in an entirely different way.

The ideas in this talk got me thinking about color on a computer screen and the use of opacity — how there are many different ways to color objects using various combinations of color values and opacity such that visually, they appear the same on a computer screen.

By looking at how opacity is implemented in a typical graphics program, this phenomenon may be analyzed mathematically.  I’ve just scratched the surface in the last two posts; there’s definitely more to be done here.

Working with Nick to get prepared for the Bridges conference was also valuable.  He created fractal images using a particular recursive algorithm he developed.

Most recently, Nick generated a series of fractal images based on a certain parameter.  When this parameter is below some threshold value, the image looks like fractal dust.  Above this threshold value, and the image overlaps itself.  But there seems to be a particular value where parts of the fractal just touch.

Sometimes finding such threshold values can be very difficult.  But I have a hunch we might be able to calculate it for some of the simpler fractals, and I look forward to the challenge.

There were many, many other conversations about mathematics and art over the past year — but these jump out to me as significant.

Any mathematician reading will naturally say, “Of course!”  This is the way that most mathematicians I know work on a daily basis.  It is often useful to share work with others and bounce your ideas off them, just like in most other disciplines.

I think it less likely that a non-mathetician would see the social aspect of doing mathematics.  So I thought I’d talk about that today.

A final “Thank you!” to my loyal followers.  I’ll keep talking, traveling, creating art, and introducing you to others who have inspired me along the way.  Time to begin Year Two!

## Vienna!

Last week, I attended the Symmetry Festival 2016  in Vienna!  I’d like to share some highlights of the week.

The first was a sculpture based on a hypercube net.  One of the most famous illustrations of this geometrical object is Dali’s Crucifixion.

Without going into too many details, eight cubes may be folded into a four-dimensional cube — called a hypercube or tesseract — just as a net of six squares may be folded into a cube.  Because folding a flat net of six squares requires folding into the third dimension, folding a hypercube net requires a fourth spatial dimension.

Analogously, just as the squares are not distorted as they are folded into the third dimension, the cubes are not distorted when folded into the fourth dimension.  A little mind-blowing, but true.

Silas Drewchin created the following sculpture based on the hypercube net.

You’ll notice a few differences:  there is an extra cube added, for a total of nine cubes.  And there are three additional struts added to support the net being tilted at an angle.  Here is what he says about those design elements:

The Hypercross is a metaphor of acceptance….By giving the Hypercross an extra base cube, the mathematical purity of the net tesseract is shattered because a true tesseract only has two base cubes. To disfigure the purity of Christian symbolism embedded in the tesseract, it is tilted to an acute angle as if it is tumbling to the ground. Without this tilted adaptation the sculpture would look dogmatic. The hybrid distortions of the mathematical form and religious form actually add to the message of acceptance.

An additional feature of this work relates to the shadows it casts.  The photo speaks for itself.

A fascinating piece!  I’m a big fan of the fourth dimension, and always appreciate when it arises in mathematical and artistic contexts.

The second highlight for me was meeting someone who is interested in creating the same type of digital images I do.  I had met Paul Gailiunas before at previous conferences, but never knew of his interest.  Here is an adaptation of one of his images — you’ll notice a similarity to those I recently posted on Twitter (@cre8math, 2016 July).

What was facscinating to me was how he created images like these.  I first discussed these images on Day007, where I used the same recursive algorithm typically used to create a Koch snowflake:

F  +60  F  +240  F  +60  F.

But Paul used a different recursive algorithm, which I’ll briefly describe — it definitely has a similar flavor, but there are important differences.  Define a function R so that R(1) means move forward and make a turn of some specified angle a, and R(2) means move forward and make a turn of some angle b.  Then recursively define

R(n) = R(n – 1) R(n – 2).

For example, choosing n = 3 gives the two segments produced by

R(3) = R(2) R(1).

But to obtain R(4), we need to use recursion:

R(4) = R(3) R(2) = R(2) R(1) R(2).

This recursive process may be repeated indefinitely.

This algorithm, like the one used to generate the Koch curve, sometimes closes up and exhibits rotational symmetry.  One challenge in this case is that the center of symmetry is not the origin of the coordinate system!  A rigorous mathematical proof of which choices of angles a and b generate a closed, symmetric curve is still forthcoming….

A third highlight was the Family Day activities in front of the Karlskirche in the Karlsplatz.  At conferences like these (such as the upcoming Bridges conference in Finland), there is a day where mathematics and art activities take place in a public venue, and anyone walking by can sit down and participate.

I sat down at the table demonstrating the Poly-Universe, a system of geometrical forms created by Janos Saxon-Szasz.  They were fun to play with, and rather challenging as well!

I was happy to have solved the puzzle illustrated here — put together all 24 tiles to make a system of hexagons so that the colors and shapes all match.  There are many solutions, but none are easy to find.

What makes these forms interesting is that each tile includes four colors and parts of four differently sized circles.  Moreover, they occur in all possible combinations — and since there are 4 sizes of circles, there are 4! = 24 possible configurations.

There are also forms made from triangles and squares, which pose a different challenge.  I moved to help a young girl and her mother try to put together a 6 x 4 rectangle from the 24 square pieces, but was not so successful there.  At some point you have to move on to see the other exhibits….

A final highlight was the Natural History museum in central Vienna.  They had an extensive array of minerals and gems — the largest collection I’ve ever seen.  The colors and textures were diverse and beautiful, and of course when looking at crystal structures, there’s a lot of geometry.

Because the rhombic dodecahedron is space-filling, it tends to occur as the basis for crystal structures, as shown here.

It is always remarkable to me how nature is constrained by geometry — or maybe geometry is derived from nature?  Regardless of how you look at it, the interaction of geometry and nature is fascinating.

The week went by pretty quickly, as they usually do when attending conferences like these. Stay tuned for further updates on my European adventure!  (I’m also tweeting daily at @cre8math.)

## Making Movies with Processing IV

Last week, we saw how using linear interpolation allowed us to create animations of fractals.  This week, we’ll explore how to create another special effect by using linear interpolation in a different way.  We’ll build on last week’s example, so you might want to take a minute to review it if you’ve forgotten the details.

Let’s suppose that in addition to morphing the Sierpinski triangle, we want to slowly rotate it as well.  So we insert a rotate command before plotting the points of the Sierpinski triangle, as shown here:

First, it’s important to note that the rotate command takes angles in radian measure, not degrees.  Recall from your trigonometry classes that

$360^\circ=2\pi{\rm \ radians.}$

But different from your trigonometry classes is that the rotation is in a clockwise direction.  When you studied the unit circle, angles moved counter-clockwise around the origin as they increased in measure.  This is not a really complicated difference, but it illustrates again how not every platform is the same.  I googled “rotating in processing” to understand more, and I found what I needed right away.

Let’s recall that p is a parameter which is 0 at the beginning of the animation, and 1 at the end.  So when p = 0, there is a rotation of 0 radians (that is, no rotation), and when p = 1, there is a rotation of $2\pi$ radians, or one complete revolution.  And because we’re using linear interpolation, the rotation changes gradually and linearly as the parameter p varies from 0 to 1.

Let’s see what effect adding this line has.  (Note:  Watch the movie until the end.  You’ll see some blank space in the middle — we’ll explain that later!)

What just happened?  Most platforms which have a rotate command assume that the rotation is about the origin, (0,0).  We learned in the first post that the origin in Processing is in the upper left corner of the screen.  If you watch that last video again, you can clearly see that the Sierpinksi triangle does in fact rotate about the upper left corner of the screen in a clockwise direction.

Of course this isn’t what we want — since most of the time the fractals are out of the view screen!  So we should pick a different point to rotate around.  You can pick any point you like, but I though it looked good to rotate about the midpoint of the hypotenuse of the Sierpinski triangles.  When I did this, I produced the following video.

So how did I do this?  It’s not too complicated, but let’s take it one step at a time.  We’ve got to remember that before scaling, the fractal fit inside a triangle with vertices (0,0), (0,2), and (2,0).  I wanted to make it 450 pixels wide, so I scaled by a factor of 225.

This means that the scaled Sierpinski triangle fits inside a right triangle with vertices (0, 0), (0, 450), and (450, 0).  Using the usual formula, we see that the midpoint of the hypotenuse of this triangle has coordinates

$\dfrac12\left((0,450)+(450,0)\right)=(225,225).$

To make (225, 225) the new “origin,” we can just subtract 225 from the x– and y-coordinates of our points, like this:

Remember that the positive y-axis points down in Processing, which is why we use an expression like 225 – y rather than y – 225.  This produces the following video.

This isn’t quite what we want yet, but you’ll notice what’s happening.  The midpoint of the hypotenuse is now always at the upper left corner.  As the triangle rotates, most of it is outside the view screen.  But that’s not hard to fix.

All we have to do now is move the midpoint of the hypotenuse to the center of the screen.  We can easily do this using the translate function.  So here is the complete version of the sierpinski function, incorporating the translate function as well:

So let’s briefly recap what we’ve learned.  Rotating an image is not difficult as long as you remember that the rotate function rotates about the point (0,0).  So first, we needed to decided what point in user space we wanted to rotate about – and we chose (225, 225) so the fractals would rotate around the midpoint of the hypotenuse of the enclosing right triangle.  This is indicated in how the x– and y-coordinates are changed in the point function.

Next, we needed to decided what point in screen space we wanted to rotate around.  The center of the screen seemed a natural choice, so we used (384, 312).  This is indicated in the arguments to the translate function.

And finally, we decided to have the triangles undergo one complete revolution, so that p = 0 corresponded to no rotation at all, and p = 1 corresponded to one complete revolution.  We accomplished this using linear interpolation, which was incorporated into the rotate function.

But most importantly — we made these changes in the correct order.  If you played around and switched the lines containing the translate and rotate functions, you’d get a different result.

It is worth remarking that it is possible to use the rotate function first.  But then the translate function would be much more complicated, since you would have to take into account where the point (384, 312) moved to.  And you’d have to review your trigonometry.  Here’s what the two lines would need to look like:

As you can see, there is a lot more involved here!  So when you’re thinking about designing algorithms to produce special effects, it’s worth thinking about the order in which you perform various tasks.  Often there is a way that is easier than all the others — but you don’t always hit upon it the first time you try.  That’s part of the adventure!

Next week we’ll look a few more special effects you can incorporate into your movies.  Then we’ll look at actual movies made by students in my linear algebra class.  They’re really great!

## Logic Puzzles II

Last week, we looked at solving some simple logic puzzles.  This week, the logic puzzle is quite a bit more involved —  I hope you enjoy it!

Six logical friends — Arlen, Boris, Cecil, Doran, Edith, and Frank — having just finished some pretty hairy logic problems, decided to go to Wacky Jack’s Primo Ice Cream Emporium to celebrate. Each ordered their ice cream in a waffle cone or a dish, except for the one who ordered the Slurp-A-Licious Bucket-O-Yum — a delectable concoction with two scoops each of Jack’s five Specialty Flavors — in which case it came in a commemorative Wacky Jack Bucket (which you got to keep if you ate it all). From the following clues, can you decide who ordered what?  Note: All solvers made their selections from Jack’s five Specialty Flavors: Blueberry Farkle, Chocolate Smudge, Marshmallow Whoop, Pecan Passion, and Peppermint Blast. For the cones, you must specify the order of the scoops.

1. No cone had more than three scoops of ice cream, and no dish had more than five.
2. Except for the problem solver who got the Slurp-A-Licious Bucket-O-Yum, no one got more than one scoop of the same flavor.
3. The number of scoops in Edith’s dish was the same as the sum of the numbers of scoops in Arlen’s and Cecil’s cones.
4. Cecil and Edith together had the same number of scoops as Arlen and Frank together.
5. If Frank had an even number of scoops, then there were 23 scoops among the six solvers.
6. If Frank had an odd number of scoops, then there were 25 scoops among the six solvers.
7. If Boris had an odd number of scoops, then Edith had an even number.
8. Boris had fewer scoops than Doran.
9. Exactly two solvers had exactly three scoops of ice cream.
10. Frank ordered a dish if and only if Boris ordered a cone.
11. Arlen had three scoops of ice cream if and only if no two cones had the same number of scoops.
12. Exactly four solvers had Marshmallow Whoop, exactly four had Pecan Passion, and exactly two had both.
13. Either Arlen’s flavors were a subset of Edith’s, or Frank’s were a subset of Cecil’s.
14. Frank did not order Pecan Passion, and Cecil did not order Marshmallow Whoop.
15. If Cecil ordered just one scoop, then Arlen ordered Pecan Passion.
16. Boris and Doran were the only two to order Peppermint Blast.
17. Arlen and Frank had no flavors in common if and only if Boris and Frank had exactly one flavor in common.
18. Two cones had a scoop of Chocolate Smudge second from the top.
19. Frank had exactly two scoops if and only if Pecan Passion was always the bottom scoop of the cone it was on.

## Envelopes III: Art and Randomness

This week, I’ll discuss some of the artistic decisions made in producing the images in last week’s post, as well as explore randomly-generated envelopes.

First, let’s look at the following piece.

Initially, I created the image below, which is essentially a recreation of a hand-drawn sketch made in 1983.

Although the lines are clean and precise, the overall impression lacks a hand-drawn feel. I thought to create more texture by having the alternating envelopes go around the origin more than once, as seen here.

I liked this better, but I thought to adjust the angular sizes of the envelopes so that the tips were evenly spaced around a circle. I also adjusted the number of lines in each envelope, producing the final result.

The point of this discussion is to illustrate the process of creating digital art – it’s not as simple as just writing a few lines of code and executing them. There is an iterative give-and-take to the process, which is half the fun of it, anyway.

The next image I’d like to look at is the spiral, shown below.

This is a recreation of an image originally drawn in red, and I thought to create texture by introducing a color gradient. However, using a linear color gradient from the first line to the last produced the following result.

This looked a little off to me – moving toward the green a bit too fast. Now if you remember the discussion of color gradients when we looked at the Evaporation piece (see Day012), you’ll recall that we could create nonlinear gradients which created different visual effects. I found that changing the gradient from linear (a power of 1) to a power of 0.8 produced something I liked more. Of course the difference is not drastic, but I want to illustrate the fact fine-tuning parameters can introduce subtle effects in the final image.

Now on to a discussion of randomly-generated envelopes. Today will only be an introduction – there’s lots more to explore, including envelopes in three dimensions.  But I’ve only begun working on this idea a few weeks ago, and so hope to illustrate how previous work with randomness may be incorporated into the design of envelopes.

Of course just what is random is a more subtle question here. Below is an image where the successive endpoints used to create the envelope are randomly chosen from a unit square, and a color gradient is produced from the beginning to the end to give a sense of motion.

You’ll immediately notice that some envelopes span the entire width or height of the image. As it happens, this makes finding nicely-balanced images difficult. I looked at a few hundred images before I found the one above – most lacked balance.

I also wanted to try bright colors against black – this produces nice results for an online blog (though not so wonderful for a printed image). Again, I didn’t like the results obtained by allowing the points determining the envelopes to be completely random. So I introduced a constraint that the endpoint of the next segment had to be “close” to the previous one – in the image below, the endpoints could be no further than one unit in either the x- or y-direction from the previous point. So there are more local effects, and none of the broader lines slicing the image in half.

The image looked a little too square, and I thought the contrast too much for so many envelopes.  So I looked at a few hundred more images on a wider field, this time in yellow. I found one with some interesting interactions, shown below.

Now I felt I was getting somewhere. But I thought the image looked a bit too flat – I wanted to add some texture or dimensionality to the image.

The first thing I tried was slightly varying the yellows used to draw the lines. This helped to add a measure of interest to the envelope. But the background needed some work.

I wanted the background to contrast the flowing curves of the envelopes, and so I thought some overlapping squares of varying dark shades of gray might do the trick. Here is the result.

The background took a few hundred iterations as well. Now I didn’t want the squares too small, and I didn’t want too many – the sizes of the squares should compare to the sizes of the individual envelopes, and there should be roughly as many. But the problem was that randomly-generated sets of squares would often leave too many gaps in the background – and simply overlaying a background of a single shade of gray wasn’t particularly pleasing.

So I had to play with the parameters generating the overlapping squares, as well as try a few hundred iterations until I found something with a nice balance. In addition, I wanted the background to be “interesting” in the largish hole just left of center – some iterations just produced a solid gray there, which didn’t work for me.

It took a bit of time – as well as feedback from my friend Sandy (thanks, Sandy!) to whom I showed successive drafts of this image – but I finally found a combination of colors/backgrounds which I felt held together. Of course you might think otherwise – and you are welcome to give it a try and create your own image with randomly-generated envelopes….

I hope this helps to illustrate the creative process – one of the main themes of this blog. While a final image may look complex with various different aspects interacting with each other, it’s not always the case that each aspect was conceived of at the same time. This is the great thing about computer-generated art – it’s so easy to explore a multitude of ideas without leaving the comfort of your keyboard.

But this is also perhaps the greatest challenge – because you can do so much, finding the right balance between simplicity and complexity in part distinguishes computer-generated images from computer-generated art.

Finally, I cannot resist including an image I tweeted a few days ago @cre8math — a variation on the spiral theme.  I find it unusually compelling.

## Envelopes II: Making Spirals

While I don’t intend to make a habit of midweek posts (though thanks for the idea, Dane!), last week’s entry was so popular that I thought I’d write a short post on how the spiral designs are created.  Here’s one of last week’s images to refresh your memory.

These are not difficult to create,  but because of all the overlap of lines, it’s not immediately obvious how they are generated.  The image below shows the first forty line segments drawn, and highlights the endpoints of these segments.

The first line drawn is horizontal, and the endpoints are 180 degrees apart.   More lines are generated by having the orange endpoint (starting at the right) move 4 degrees counterclockwise, while the green endpoints (starting at the left) move just 3 degrees.  As a result, the endpoints of the second segment are just 179 degrees apart on the circle.  The orange endpoints start gaining on the green endpoints, closing the gap by 1 degree with each successive segment.

So the final spiral includes exactly 180 segments, which may be expressed in a form which may be easily generalized (and which is used in the Python code).  Note that the “180” on the left side of the equation represents the number of segments drawn, and the “180” on the right indicates the angular distance that the endpoints of the initial segment are separated on the circle.

$180 = \dfrac{180}{4-3}.$

All 180 segments are shown below, where the endpoints are retained to illustrate the process (although note that many endpoints are written over as the algorithm progresses).

The Python code is fairly short (here is the Sage link — look at some of the earlier posts about using Sage if you haven’t used it before). The only mathematics you need to understand is the standard conversion from polar to rectangular coordinates — it’s much easier to describe the endpoints first in polar coordinates since the radius of the circle is fixed and only the angles the endpoints make with the center of the circle change.

Finally, I include an image created with contrasting colors on the background as well.  Create your own version, and post as a comment!