
CMU CS Regular Poygons and Stars
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Easy
Maria Cruz Farooqi
Used 2+ times
FREE Resource
7 Slides • 3 Questions
1
2
Regular Polygons
We know how to draw a square -- we use Rect and make the width and height the same. But what about a triangle? Or a pentagon (with 5 sides) or a hexagon (with 6 sides), and so on? These are called regular polygons, and we draw these using
RegularPolygon.
3
We draw a regular polygon similarly to a circle -
- with an (x,y) center and a radius.
We just need one more argument: the number of points (or sides, if you prefer, since there are the same number of points as sides). Here is how we draw a hexagon centered at (200, 100) with a radius of 75:
RegularPolygon( 200, 100, 75, 6 )
4
We can see that this fits just inside a circle:
Circle(200, 100, 75, fill='cyan') RegularPolygon(200, 100, 75, 6)
5
Multiple Choice
What happens if you run the previous code with 100 sides?
It looks like a square.
It looks like a line.
It looks like a circle.
It crashes (you cannot draw a 100-sided regular polygon).
6
Circle(200, 100, 75, fill='cyan')
RegularPolygon(200, 100, 75, 100)
7
Stars
We draw a star in the same way that we draw a RegularPolygon:
Star(200, 100, 75, 5)
​We can see that this, too, fits just inside a circle:
Circle(200, 100, 75, fill='cyan')
Star(200, 100, 75, 5)
8
Roundness
You probably have a clear idea what a 5-sided star should look like -- basically, like it does on any flag. Same goes for a 6-sided star. But a 7-sided star is less obvious.
Which of the following is the right shape for a 7-sided star? 7-sided stars of different roundnesses. We see that there are many different kinds of 7-sided stars, some are more circular or rounder than others. The same is true for all stars. When we create a star, we can set its roundness to any value between 0 and 100. For example:
​Star( 80, 130, 35, 7, roundness=20) Star(160, 130, 35, 7, roundness=40) Star(240, 130, 35, 7, roundness=60) Star(320, 130, 35, 7, roundness=80)
9
Dropdown
Star (
10
Dropdown
Star (
Show answer
Auto Play
Slide 1 / 10
SLIDE
Similar Resources on Wayground
6 questions
Big Data- Lesson 4
Presentation
•
9th - 12th Grade
10 questions
Surface Area
Presentation
•
9th - 12th Grade
11 questions
Los números naturales y sus propiedades
Presentation
•
9th - 12th Grade
10 questions
Regular Present Tense ER and IR Verbs
Presentation
•
9th - 12th Grade
10 questions
Added Sugar Effects
Presentation
•
9th - 12th Grade
9 questions
-ER verbs Lesson
Presentation
•
9th - 12th Grade
6 questions
Falling Objects, Launching Objects, and Projectile Pathways
Presentation
•
9th - 12th Grade
9 questions
Logarithms
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade