Turtle geometry is a method of describing curves by successive motions of a point with a heading, specifying how far it moves and how much it turns (Abelson and diSessa 1981). Each turn is relative to the moving point's current direction, so a fixed instruction list can be repeated from any initial position and direction. The mathematical framework underlies turtle graphics.
The figure shows an equilateral triangle, a square, and a spirolateral constructed using left turns. Arrows indicate the direction of travel, and orange dots mark the starting points. The examples are shown at independent scales.
In a complex plane description, the heading is measured from a fixed reference axis. A straight move of length followed by a turn through angle
updates the position
and heading
by
|
(1)
| |||
|
(2)
|
Repeating a finite instruction list applies the same rigid motion to each successive copy of its trace. A nontrivial rotation of finite order produces a closed trace after finitely many copies. A nonzero translation instead produces an unbounded chain, while the identity transformation repeats the trace in place. The total turn alone does not distinguish the last two cases.
Integer sequences can supply the turns or move lengths (Colestock 2017). Basic spirolaterals use a fixed turn and a repeating list of move lengths. The N-curve construction instead uses circular arcs of equal arc length whose turns are determined by residues of an integer sequence.
The Wolfram Language function AnglePath[steps] generates planar turtle paths by turning before each move. The function AnglePath3D[steps] extends the construction to space using successive rotations of a moving coordinate frame.