A Program to Interpolate (and Extrapolate) between Turtle Programs

Ken Kahn
Bridges London: Mathematics, Music, Art, Architecture, Culture (2006)
Pages 109–114


People have been creating geometric figures with computer programs consisting of turtle commands such as forward and right since the late 1960s [1]. Here I describe a program that takes in two such programs and produces a new program capable of producing both figures and all the intermediate figures. It can produce a figure that is one third circle and two thirds triangle or one that is half star and half pentagon. The program produced by interpolating, say, a square and a circle program takes in a number between zero and one and produces a figure between a square and a circle. If, however, it is given a number greater than one, or a negative number, it will produce an extrapolation between a square and circle. Interpolated programs can be the basis of playful aesthetic explorations. The intermediate forms can be drawn on the same image. Or animations can be generated where the figures morph into (and beyond) each other. Colours and other attributes of the turtle pen can also be interpolated. Unlike conventional morphing programs, we are interpolating between computational processes rather than static images.