Fireworks, Flags and the Fourth of July
In the U.S., Independence Day is soon upon us (for the rest of the world it’s the fourth of July). The national holiday celebrates the adoption of the Declaration of Independence on July 4, 1776. Americans honor the day with family and friends, cookouts and barbeques, parades and … fireworks. Earlier this year, I wrote some Python lessons leading up to a “fireworks” display and a flag display for both the TI-Nspire™ CX II and the TI-84 Plus CE Python graphing calculators:
Try the Fireworks activity shown above which is found in the recently added sections “Python Modules” on TI Codes for the TI-Nspire™ CX II graphing calculator and TI Codes for the TI-84 Plus CE Python graphing calculator. You will find the fireworks activity in the "Turtle Graphics" section, and you will need the Turtle module on your calculator or computer software.
The code that generates one star polygon is:
- n is an odd number between 5 and 11. The is the number of vertices on the polygon. To make a regular polygon we use 360/n for the turtle’s turning angle since the sum of the exterior angles of a polygon is 360 degrees. But ...
- r is the number of revolutions the turtle makes to complete a star polygon. The value int(n/2) gives the “pointiest” stars. Why? If I use a larger or smaller value, then the vertex angles (the points of the stars) will be larger. Either int(n’2 or int(n/2)+1 yield the smallest vertex angles. Try it yourself.
See the online lesson in TI Codes for all the details and step-by-step instructions.
On another patriotic note, the U.S. flag is another great opportunity to put coding skills and art to work for this holiday. In the same Python Modules > TI Draw sections there’s an activity (Mini Project 2) to make the flag of the State of Texas:
Taking a closer look at the geometry in the image above, what would it take to make the U.S. flag? (Warning: You might need some patience to go with your patriotism!)
Tip: You can use both ti_draw functions (to make the red, white and blue rectangles) and Turtle functions (to make the stars) in the same program. Here’s some Turtle code that makes some of the stars. Note that there are six rows with five stars each and four rows with five stars for the total of 50 stars. This section makes the five-star rows at the proper positions in the blue field:
The code shown here will work on the TI-84 Plus CE Python as well, except for the paint_buffer() function at the end.
Note that the nested for loops call a function star() which is not shown here.
Another great idea for screen fireworks comes from a completely different activity found in the Beyond Basics section of TI-Basic programming on the TI-84 Plus CE graphing calculator as the conclusion of the Basketball Game. The code here is translated from the TI-Basic version online and adapted for the Python environment:
A close inspection of the code above reveals that the arcs of the blue and white fireworks display are each a different parabola emanating from the same point (80, 160). Here’s your engaging answer to “when will we ever use this?” Add a while loop and introduce some random values into the program so you can put on a great show. Happy Independence Day, U.S.A.!
About the author: John Hanna is a retired teacher splitting time between sailing in New Jersey and mountain biking in Florida (did he get that backwards?), still getting kicks out of working with TI to provide feedback on new products, and developing meaningful programming content for mathematics and science ... and still having fun with all the graphing calculators and the accompanying toys.
Tagcloud
Archive
- 2024
-
2023
- January (3)
- February (3)
- March (5)
- April (3)
- May (3)
- June (3)
- July (2)
-
August (6)
- 5 Ways to Spruce Up Your Classroom for Back to School
- Day of the Dog: Which Dog Is Roundest?
- Women Who Code: A TI Intern’s Fascinating STEM Journey
- 6 Sensational TI Resources to Jump-Start Your School Year
- 3 Back-to-School Math Activities to Reenergize Your Students
- A New School Year — A New You(Tube)!
- September (2)
- October (3)
- November (1)
- 2022
-
2021
- January (2)
- February (3)
- March (5)
-
April (7)
- Top Tips for Tackling the SAT® with the TI-84 Plus CE
- Monday Night Calculus With Steve Kokoska and Tom Dick
- Which TI Calculator for the SAT® and Why?
- Top Tips From a Math Teacher for Taking the Online AP® Exam
- Celebrate National Robotics Week With Supervised Teardowns
- How To Use the TI-84 Plus Family of Graphing Calculators To Succeed on the ACT®
- AP® Statistics: 6 Math Functions You Must Know for the TI-84 Plus
- May (1)
- June (3)
- July (2)
- August (5)
- September (2)
-
October (4)
- Transformation Graphing — the Families of Functions Modular Video Series to the Rescue!
- Top 3 Halloween-Themed Classroom Activities
- In Honor of National Chemistry Week, 5 “Organic” Ways to Incorporate TI Technology Into Chemistry Class
- 5 Spook-tacular Ways to Bring the Halloween “Spirits” Into Your Classroom
- November (4)
- December (1)
-
2020
- January (2)
- February (1)
- March (3)
- April (1)
- May (2)
- July (1)
- August (2)
- September (3)
-
October (7)
- Tips for Teachers in the time of COVID-19
- Top 10 Features of TI-84 Plus for Taking the ACT®
- TI Codes Contest Winners Revealed
- Best of Chemistry Activities for the Fall Semester
- Best of Biology Activities for the Fall Semester
- Best of Physics Activities for the Fall Semester
- Best of Middle Grades Science Activities
- November (1)
- December (2)
- 2019
-
2018
- January (1)
- February (5)
- March (4)
- April (5)
- May (4)
- June (4)
- July (4)
- August (4)
- September (5)
-
October (9)
- Art in Chemistry
- Which Texas Instruments (TI) Calculator for the ACT® and Why?
- Meet TI Teacher of the Month: Jessica Kohout
- Innovation in Biology
- Learning With Your Students
- A first-of-its-kind STEM strategy charts path to help educators
- #NCTMregionals Hartford 2018 Recap
- The Math Behind “Going Viral”
- Real-World Applications of Chemistry
-
November (8)
- Testing Tips: Using Calculators on Class Assessments
- Girls in STEM: A Personal Perspective
- 5 Teachers You Should Be Following on Instagram Right Now
- Meet TI Teacher of the Month: Katie England
- End-of-Marking Period Feedback Is a Two-Way Street
- #NCTMregionals Kansas City 2018 Recap
- Slope: It Shouldn’t Just Be a Formula
- Hit a high note exploring the math behind music
- December (5)
- 2017
- 2016
- 2015