Teaching Kids Programming – How to Draw a Star using Turtle Graphics? (Math, Shapes, Geometry)


Teaching Kids Programming: Videos on Data Structures and Algorithms

What we have learned today:

The sum of total interior angles of a N-sided polygon (where N is larger or equal to 3) is:

tex_a5e0da5977377078ff7db0aea9ba7715 Teaching Kids Programming - How to Draw a Star using Turtle Graphics? (Math, Shapes, Geometry) geometry LOGO Turtle Programming math python teaching kids programming youtube video

Because we can partition a simple polygon (convex or concave, non self intersecting and no holes) into (n-2) triangles.

To draw a star, we can do this in LOGO:

repeat 5 [fd 100 rt 144]

The “100” is the length of the longest edge of the star. Or we can import the turtle graphics library:

1
2
3
4
5
6
from turtle import fd, rt
 
def star(N):
  for _ in range(5):
    fd(N)
    rt(144)
from turtle import fd, rt

def star(N):
  for _ in range(5):
    fd(N)
    rt(144)

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
259 words
Last Post: Teaching Kids Programming - Probability of Rolling a Dice: Strictly Increasing Order One After Another
Next Post: Teaching Kids Programming - Check if a String is Prefix/Suffix in Python (Two Pointer Algorithm)

The Permanent URL is: Teaching Kids Programming – How to Draw a Star using Turtle Graphics? (Math, Shapes, Geometry)

Leave a Reply