Turtle graphics
Turtle graphics is a term in computer graphics vector graphics using a relative cursor (the "turtle") upon a Cartesian plane. Turtle graphics is a key feature of the Logo programming language.[1]
Overview
The turtle has three attributes:
- a location
- an orientation
- a pen, itself having attributes such as color, width, and up versus down.
The turtle moves with commands that are relative to its own position, such as "move forward 10 spaces" and "turn left 90 degrees". The pen carried by the turtle can also be controlled, by enabling it, setting its color, or setting its width. A student could understand (and predict and reason about) the turtle's motion by imagining what they would do if they were the turtle. Seymour Papert called this "body syntonic" reasoning.
A full turtle graphics system requires control flow, procedures, and recursion: many turtle drawing programs fall short. From these building blocks one can build more complex shapes like squares, triangles, circles and other composite figures. The idea of turtle graphics, for example is useful in a Lindenmayer system for generating fractals.
Turtle geometry is also sometimes used in graphics environments as an alternative to a strictly coordinate-addressed graphics system.
History
Turtle graphics are often associated with the Logo programming language.[2] Seymour Papert added support for turtle graphics to Logo in the late 1960s to support his version of the turtle robot, a simple robot controlled from the user's workstation that is designed to carry out the drawing functions assigned to it using a small retractable pen set into or attached to the robot's body. Turtle geometry works somewhat differently from (x,y) addressed Cartesian geometry, being primarily vector-based (i.e. relative direction and distance from a starting point) in comparison to coordinate-addressed systems such as PostScript. As a practical matter, the use of turtle geometry instead of a more traditional model mimics the actual movement logic of the turtle robot. The turtle is traditionally and most often represented pictorially either as a triangle or a turtle icon (though it can be represented by any icon).
Papert's daughter, Artemis, has been using turtle graphics to explore the relationship between art and algorithm.
Today, Turtle graphics implementations are available for all major desktop and mobile platforms.
Extension to three dimensions
The ideas behind turtle graphics can be extended to include three-dimensional space. This is achieved by using one of several different coordinate models. If the turtle operates in cylindrical coordinates, then it has a location and a heading within its plane, and its plane may be rotated around the vertical axis. This often manifests itself as the turtle having two different heading angles, one within the plane and the other determining the plane's angle. Usually changing the plane's angle does not move the turtle.
Other coordinate models may also be used. The Cheloniidae, Cheloniidae Turtle Graphics, is a 3D turtle library for Java. [3]
See also
- Turtle (robot)
- Logo (programming language)
- NetLogo
- Python (programming language)
- PythonTurtle – Standalone application
- KTurtle
- StarLogo
- One Laptop per Child's XO-1 contains a Turtle Art activity for playing with turtle graphics
- L-system
- Microsoft Small Basic
- Scratch (programming language)
References
- ↑ "Turtle Geometry" (PDF).
- ↑ Thornburg, David D. (March 1983). "Friends of the Turtle: On Logo And Turtles". Compute!. p. 148. Retrieved 6 October 2013.
- ↑ Spencer Tipping on cheloniidae(retrieved 2016-9-17)
Bibliography
- Mindstorms: Children, Computers, and Powerful Ideas, 1980, ISBN 0-465-04674-6
- The Children's Machine: Rethinking School in the Age of the Computer, 1993, ISBN 0-465-01063-6
External links
- "Web Turtle", turtle graphics in a web page, by Bill Kendrick, author of Tux Paint
- "3D Flying Pipe-laying Turtle" by Tom Verhoeff from The Wolfram Demonstrations Project (retrieved on 2009-01-31)
- Turtle Art website maintained by Brian Silverman and Artemis Papert
- Turtle Blocks a full turtle graphics system included in the Sugar learning platform
- JS Turtle Graphics a simple Spanish Javascript implementation of turtle graphics, by John Villar
- JSTurtlegraphics V0.3 an English implementation aimed at children (using the more common Logo command names)
- TurtleWax An HTML5 (JavaScript and the canvas tag) implementation, by Dave Balmer
- Turtle art online a browser-based turtle graphics editor
- Prismacode another browser-based graphics editor
- TurtleGraphics package for R
- Algo An turtle graphic based object in the Algoid educational programming language, that has versions on the Raspberry Pi and Android, Linux and Windows computers.
- Logo interpreter A browser-based full logo interpreter with additional animation routines created using HTML5, CSS3 and JQuery
- SNAP! A UCB project Snap implementation incorporating turtle graphics and a scratch type GUI.
- Turtle Bezier Path Turtle graphics app and drawing library for iOS
- Python 3.5 SVG turtle graphics library