
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
CMU CS 1.3.3 Regular Polygons and Stars
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 (
CMU CS 1.3.3 Regular Polygons and Stars
Show answer
Auto Play
Slide 1 / 10
SLIDE
Similar Resources on Wayground
7 questions
Chapter 12 Section 3: Korea & It’s Traditions
Lesson
•
9th - 12th Grade
6 questions
People in Art History
Lesson
•
9th - 12th Grade
6 questions
Linear Relationships ( hints & questions)
Lesson
•
9th - 12th Grade
8 questions
Mengenal Angka
Lesson
•
KG
8 questions
APPLE
Lesson
•
9th - 12th Grade
8 questions
S1 Estructura 3.4 Tener and Venir
Lesson
•
9th - 12th Grade
11 questions
Spanish 1 Los #s 20-100
Lesson
•
9th - 12th Grade
7 questions
Airbnb - Making a Profit
Lesson
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
13 questions
SMS Cafeteria Expectations Quiz
Quiz
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
SMS Restroom Expectations Quiz
Quiz
•
6th - 8th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
10 questions
Pi Day Trivia!
Quiz
•
6th - 9th Grade
Discover more resources for Computers
10 questions
Pi Day Trivia!
Quiz
•
6th - 9th Grade
15 questions
Pi Day Trivia!
Quiz
•
9th Grade
15 questions
Pi Day Trivia
Quiz
•
9th - 12th Grade
10 questions
Understanding Pi and Its Applications
Interactive video
•
7th - 12th Grade
10 questions
Cell Organelles and Their Functions
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
5 questions
Did You Know? Ireland
Interactive video
•
9th - 10th Grade
10 questions
Exploring Basic Probability Concepts
Interactive video
•
6th - 10th Grade