4  Turtle Graphics

In computer graphics a turtle denotes a drawing device that moves step by step on a surface and draws a connected line with a pen. The turtle is controlled by a computer program that can emit simple commands. For example, after each step the direction for the next step can be changed. Today the turtle is no longer a mechanical device but is simulated on the monitor.

The classic computer language with build-in turtle graphics is Logo (Netlogo, Logo Foundation). Even simple Logo programs can generate grapics with complex structure and fractal properties (Logo Graphics Gallery->Recursive Graphic Designs).

Another possibility to control the turtle are Lindenmayer systems (MathePrisma: Lindenmayersysteme, Fraktalwelt: L-Systems).

The methods mentioned above for controlling the turtle are meant to generate highly complex images from simple rules which are applied recursively. The sequence of rotation angles for the turtle is in this situation of a simple nature. If instead a mathematically more complex sequence is used, e.g.

\[ \sqrt {2}\,n,\, n=1,2, \dots ,          \]

a connection to the theory of exponential sums is established. The resulting pictures may show geometrical structures whose explanation requires a deeper mathematical analysis:

Turtle-Grafik zur Folge

Turtle Gallery:

\( \sqrt {n},\, n=1,2, \ldots \) \( \log (n),\, n=1,2, \ldots \) \( \sin (\sqrt {n}),\, n=1,2, \ldots \) \( \sqrt {\log {n}}, n=1,2, \ldots \)
\( \sqrt {n}\sin {n},\, n=1,2, \ldots \) \( \sqrt {n}\log {n},\, n=1,2, \ldots \) \( \tan (\sqrt {n}),\, n=1,2, \ldots \) \( \sin (n^2),\, n=1,2, \ldots \)
\( \sqrt {2}\,n,\, n=1,2, \ldots \) \( \sqrt {2}\, n^2,\, n=1,2, \ldots \) \( \tan (n),\, n=1,2, \ldots , 200000 \) \( \tan (n),\, n=1,2, \ldots , 500000 \)
\( \tan (n),\, n=1,2, \ldots , 1000000 \) \( \sin (n \,\mbox {xor}\, 2),\, n=1,2, \ldots \) \( \sin (n \,\mbox {xor}\, 3),\, n=1,2, \ldots \) \( \sin (n \,\mbox {xor}\, 5),\, n=1,2, \ldots \)