Project 3: The Ballistics Computer (Trigonometry Simulator)
Build a simulator that predicts projectile motion using angles and velocity.
Project Overview
| Attribute | Value |
|---|---|
| Difficulty | Level 1: Beginner |
| Time Estimate | Weekend |
| Main Language | Python |
| Alternative Languages | JavaScript, C++ |
| Knowledge Area | Trigonometry and kinematics |
| Tools | Plotting tool |
| Main Book | “Physics for Scientists and Engineers” by Serway & Jewett |
What you’ll build: A simulator that shows the trajectory of a projectile given initial velocity and angle.
Why it teaches math: Trig and algebra directly control real-world motion and distance.
Core challenges you’ll face:
- Converting angle to x/y components
- Computing flight time and range
- Handling different initial heights
Real World Outcome
You will input an angle and velocity and see a plotted trajectory with range and maximum height.
Example Output:
$ python ballistics.py --angle 45 --speed 30
Range: 91.8 m
Max height: 22.9 m
Flight time: 4.3 s
Verification steps:
- Compare results for 45 degrees vs other angles
- Validate with known kinematic formulas
The Core Question You’re Answering
“How does an angle turn into a real trajectory and landing point?”
This is trigonometry in action.
Concepts You Must Understand First
Stop and research these before coding:
- Trig components
- How do sine and cosine split velocity into x and y?
- Book Reference: “Precalculus” by James Stewart, Ch. 5
- Projectile motion equations
- How do you compute position over time under gravity?
- Book Reference: “Physics for Scientists and Engineers” by Serway & Jewett, Ch. 3
- Range and max height
- How do you derive formulas for range and peak?
- Book Reference: “Physics for Scientists and Engineers” by Serway & Jewett, Ch. 3
Questions to Guide Your Design
- Time stepping
- Will you compute positions analytically or via simulation steps?
- How small should the time step be?
- Visualization
- Will you plot the path or animate it?
- How will you mark key values?
Thinking Exercise
Angle Comparison
Compute the range for angles 30, 45, and 60 degrees with the same speed. Which is longest?
Questions while working:
- Why does 45 degrees maximize range without air resistance?
- What changes if launch height is not zero?
The Interview Questions They’ll Ask
Prepare to answer these:
- “Why does 45 degrees maximize range?”
- “How do you decompose velocity into components?”
- “What assumptions does projectile motion make?”
- “How does launch height affect flight time?”
- “How would air resistance change the model?”
Hints in Layers
Hint 1: Starting Point Start with formulas for x(t) and y(t).
Hint 2: Next Level Compute when y(t) reaches zero to find flight time.
Hint 3: Technical Details Use radians for trig functions and keep units consistent.
Hint 4: Tools/Debugging Plot the trajectory and verify symmetry for zero launch height.
Books That Will Help
| Topic | Book | Chapter |
|---|---|---|
| Trig components | “Precalculus” by James Stewart | Ch. 5 |
| Projectile motion | “Physics for Scientists and Engineers” by Serway & Jewett | Ch. 3 |
| Kinematics | “Physics for Scientists and Engineers” by Serway & Jewett | Ch. 3 |
Implementation Hints
- Use analytic equations first, then add simulation as a check.
- Keep gravity as a parameter for experimentation.
- Label axes and key points on the plot.
Learning Milestones
- First milestone: You can compute range and max height.
- Second milestone: You can plot trajectories for any angle.
- Final milestone: You can explain why trajectories are parabolic.