1.2. Mondrian and Computer Art
During the years of the first world war, the Dutch painter Piet Mondrian developed a new style of abstract art called neoplasticism, which is often characterized by rigidly geometrical patterns of horizontal and vertical lines. The tendency in Mondrian's work toward such simple geometrical patterns makes his style especially appropriate for computer simulation. Many of the early attempts to generate "computer art" were based on this style. Consider, for example, the following abstract design:
In this example, the design consists of a large rectangle broken up into smaller rectangles by a sequence of horizontal and vertical lines.
For the moment, it is sufficient to outline a general strategy for generating such designs. (The details of the actual program appear in Chapter 9, which includes an exercise based on this example.) To discover such a strategy and determine how recursion is involved, it helps to start at the beginning and follow the development of this kind of design. As with any work of pictorial art (however loosely the term applies in this case), the design starts out as an empty "canvas":
The first step in the process is to divide this canvas into two smaller rectangles with a single vertical line. From the finished drawing, you can ...
Get Thinking Recursively with Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.