We will use the 5 pixel grid to trace out this image. The image of this is shown below:
The plan to draw this symbol is given below:
- Lift up the pen
- Set the pen size to 20 pixels
- Set the heading of the pen to 0 degrees
- Move the pen back by 70 pixels
- Place the pen down
- Move forward by 140 pixels
- Move the pen back to the home position
- Set the heading of the pen to 90 degrees
- Move the pen back by 60 pixels
- Move forward by 120 pixels
- Set the heading of the pen to 180 degrees
- Move forward by 60 pixels
- Set the heading to 90 degrees
- Move forward by 90 pixels
- Set the heading of the pen to 180 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 270 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 0 degrees
- Move forward by 100 pixels
- Set the heading of the pen to 270 degrees
- Move forward by 60 pixels
- Set the heading of the pen to 180 degrees
- Move forward by 100 pixels
- Set the heading of the pen to 270 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 0 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 90 degrees
- Move forward by 90 pixels
- Set the heading of the pen to 0 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 270 degrees
- Move forward by 90 pixels
- Set the heading of the pen to 0 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 90 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 180 degrees
- Move forward by 100 pixels
- Set the heading of the pen to 90 degrees
- Move forward by 60 pixels
- Set the heading of the pen to 0 degrees
- Move forward by 100 pixels
- Set the heading of the pen to 90 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 180 degrees
- Move forward by 120 pixels
- Set the heading of the pen to 270 degrees
- Move forward by 90 pixels
- Set the heading of the pen to 180 degrees
- Move forward by 60 pixels
Using Turtle Graphics
We will use the template.py file and rename it to nssa.py.
The code for steps 1 to 10 is given below:
turtle.penup()
turtle.pensize(20)
turtle.setheading(0)
turtle.backward(70)
turtle.pendown()
turtle.forward(140)
turtle.home()
turtle.setheading(90)
turtle.backward(60)
turtle.forward(120)
The image generated is given below:
turtle.setheading(180)
turtle.forward(60)
turtle.setheading(90)
turtle.forward(90)
turtle.setheading(180)
turtle.forward(120)
turtle.setheading(270)
turtle.forward(120)
turtle.setheading(0)
turtle.forward(100)
turtle.setheading(270)
turtle.forward(60)
The generated image is shown below:
turtle.setheading(270)
turtle.forward(90)
turtle.setheading(0)
turtle.forward(120)
turtle.setheading(90)
turtle.forward(120)
turtle.setheading(180)
turtle.forward(100)
turtle.setheading(90)
turtle.forward(60)
The generated image is shown below:
turtle.setheading(0)
turtle.forward(100)
turtle.setheading(90)
turtle.forward(120)
turtle.setheading(180)
turtle.forward(120)
turtle.setheading(270)
turtle.forward(90)
turtle.setheading(180)
turtle.forward(60)
The final symbol is given below:
Nssa is one of the easier symbols to draw although the steps are involved. Its kind of fun to see the turtle go about drawing this shape.
No comments:
Post a Comment