Click 'Run' to go.

** This works a lot like the turtle's square demo,** except the loop cycles

Slow
Medium
Fast

Click 'Run' to go.

Click 'Run' to go.

*When the turtle goes around an equilateral triangle, it will rotate a total of 360 degrees:*

Like with the square, the turtle's turning angle around this equilateral polygon ** totals** to 360 degrees.

*The following picture shows each cycle of the repeat loop:
*

*
It is important to understand that although we are drawing an equilateral triangle which has internal angles equal to 60 degrees,
the turtle's turning angle is not 60 degrees.
*

**
The turtle turns through 120 degrees at each vertice of the triangle.
**
The 120 degrees is the size of the external angles for this triangle.
The turtle turns through the external angles.

This is an in equal. Since the external angles are the turtle's turning angles, all of the turtle's turning angles are equal in measure.
measureThe turtle will rotate 360 degrees as it goes around any convex polygon, including this triangle, and those 360 degrees must here be divided equally among three turtle turns. 360 degrees divided by 3 is 120 degrees. So, the turtle must turn 120 degrees at each triangle vertex. A square would have 4 turning angles, and 360 degrees divided by 4 gives us an angle of 90 degrees. An equilateral pentagon would have a turning angle of 360 degrees divided by 5, which is 72 degrees. |

*A flowchart for the turtle's triangle demo:*

*The imaginary computer code for the turtle's triangle drawing:*

repeat(3) { fd(4); lt(120); }

*Suggested next article:*