Here is M.C. Escher's "Print Gallery", and a sketch he made for it:
I love the grid and I wanted to try to get a computer to do something like it. Here's what I have so far, along with one of my sketches:
This grid doesn't match Escher's. My second try, here, does.
spiral45.ps is the postscript file that produces the full-sized grid. (If your browser won't show that directly, try spiral45_ps.txt.) If you print it or display it with GhostScript, you'll notice a delay of about a minute, depending on your printer or computer's processor speed. Postscript files really are computer programs, and this one calculates and draws a lot of tiny curve pieces.
The program is a variation of one that drew circular, dart-board-like grids. In the sketch above, you see one grid "square" tilted 45 degrees, overlaid on two squares from the circular grid. The program steps around circular bands drawing diamonds instead of squares. As the bands get closer to the center, the lines become lighter and closer together. When it's finished drawing a fine grid, the program draws a coarser grid with darker lines on top of that, and so forth.
A lot of tweaking went into the procedure "setlineweight", which translates a single "weight" number into a combination of thickness and grey scale. The thinnest lines have to be six printer pixels wide, to prevent interference with the halftone grid.
Here's a more detailed sketch about the control points for the Bezier curves. Escher's sketch is a plan for his whole picture. My sketches are of one grid square! The funny thing is I still need a sketch.
But enough of my amateur flounderings. Here is what happened when some real mathematicians tackled the problem. (And don't forget my more faithful version here.)
Up to my home page.