EZ Programing Demos

Turtle Graphics

Current topic: seth means 'set heading'. It aims the turtle by spinning it toward a certain direction.

Here directions are stated in degrees. Some examples:

• Right: 0 degrees
• Up: 90 degrees
• Left: 180 degrees
• Down: 270 degrees

Slow  Medium  Fast
Click 'Run' to go.

Stated in degrees, turtle headings here work this way: Note that a direction of directly right is 0 degrees (or 360 degrees, as we shall see). The headings increase around a counter-clockwise rotation. This us usually called a positive rotation in mathematics. If you rotate a full 360 degrees, you are back at a 0 degree heading. So, 360 degrees is the same heading as 0 degrees. And rotating further, 390 degrees is the same heading as 30 degrees.

 You use the 'set heading' (or seth) command to aim the turtle. It spins the turtle in place. You follow the command with an absolute direction given by an angle usually stated in degrees. In the actual LOGO computer language the direction of 0 degrees is straight up with increasing values for the angle rotating clockwise. So, a direction of 90 degrees would be directly to the right. At this site and at EZ Math Movie a direction of 0 degrees is directly right with increasing values for the angle rotating counter-clockwise. So, a direction of 90 degrees would be straight up. We do it that way to duplicate the behavior of an angle in 'standard position' as described in mathematics.

The flowchart for this demo: Here's how it could all look in imaginary computer code:

```
fd(4);
seth(90);
fd(4);
seth(180);
fd(4);
seth(270);
fd(4);
seth(360);
```

Suggested next article:  