9.4 Snowflakes, Lindenmayer, and Grammars

It is said that no two snowflakes are exactly alike. Snowflakes are another item in nature that can be imitated by using fractal techniques. The photo in Figure 9.7 shows a snowflake. The snowflake in Figure 9.8 was produced using the Koch snowflake curve, a fractal algorithm developed by Helge von Koch in 1906. One difference between real snowflakes and the Koch snowflake curve is our code can create multiple Koch snowflakes that are exactly alike.

A digitally rendered photo of a snowflake.

Figure 9.7 Photo of a snowflake.

Wilson Bentley. Courtesy of National Oceanic and Atmospheric Administration/Department of Commerce.

Description

Get Python Programming in Context, 4th Edition 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.