If a robot turtle were to draw its trail for you, what instructions should it be given to generate a triangle? A tree? How about a fractal image?
The idea of using a turtle to represent simple geometrical motions goes back several decades. Think of a turtle as an object that occupies a single point in the plane (a position) and points in a direction. Then it can move forward or back, or turn left or right, using a single step-size and turning-angle throughout its trip. We will use F, B, +, and - to code these four instructions.
|
Examples of fractal turtle paths |
The moving point is called a turtle because the first incarnation of these programs was run by a
turtle-like robot tracing its paths on paper.
No comments:
Post a Comment