EZ Math Movie, Tutorials, Turtle Graphics, penUp and penDown


The turtle draws, or not.

Commands like forward and back move the turtle. By default the turtle draws a line along its path as it moves, but it can also move without drawing. If you want to move the turtle and not have it draw, then you issue the command penUp:

penUp();

After the command penUp executes, the turtle will not draw as it moves. If you want to later make the turtle draw again, use the command penDown:

penDown();

The turtle draws only when the pen is down.

penUp and penDown animation

Running the example program

The example program has loop code that runs once. In this loop code the graph is set up, then the turtle is sent home and aimed 'up' at 45 degrees.

Next, the turtle is moved forward in small steps. The pen is alternately switched up and down as these forward steps execute. This creates a dashed line design.


The example program

0ptions
Angle measurement: Degrees Radians

Go on input

Bounds:
Sorry, apparently this browser does not support HTML 5 canvas tag graphics.
Printer

Edit: Runtime          View: Starter Suggestion

To runtime:

Storage:

Editor width: Normal Wide


		

	


		

	


		

	

And....

Next tutorial: setX, setY, and setXY

 

Here is a link to a related article at EZ Programing Demos:

Pen up and down


All contents of EZ Math Movie are copyrighted: Copyright 2011, Edward A. Zobel. All rights reserved.



Other sites you may find interesting

Zona Land Education Like Math and Physics?

Zona Land Education offers explanations, diagrams, and animations on these topics.
And it is all presented in a clear and casual manner.

Here is the link: zonalandeducation.com




EZ Programing Demos Want to learn about programing computers?

EZ Programing Demos has an animated, slow motion, interactive programing language demonstrator.
The site presents basic ideas at a beginner's level.

Here is the link: ezprogramingdemos.com



Custom Search

Name:
Domain:

Name
0


Name:
Name
0