Live at: https://vladimirlopez.github.io/Projectiles-Simulation-Copilot-version/
An educational web-based simulation for teaching projectile motion physics using the two-columns method (separate horizontal and vertical components).
- Use the compact embed layout by adding
?embed=1to the app URL. - Recommended iframe for Canvas Pages:
<iframe
src="https://vladimirlopez.github.io/Projectiles-Simulation-Copilot-version/app.html?embed=1"
width="100%"
height="820"
style="border:0;"
loading="lazy"
allowfullscreen
></iframe>- Notes:
- Link directly to
app.html?embed=1(not the index redirect) so the parameter is preserved. - Adjust
heightfor your Canvas theme; 760โ880px typically works. - Embed mode hides long instructions and the footer to avoid clipping; layout padding and canvas height are reduced for a tighter fit.
- Link directly to
- Vertical Projectiles: Pure vertical motion (free fall/upward throw)
- Horizontal Projectiles: Horizontal launch from height (parabolic motion)
- Angled Projectiles: Full 2D motion with angle control
- Two-Column Display: Separate visualization of horizontal (blue) and vertical (red) components
- Real-Time Animation: Watch the projectile motion with adjustable visualization
- Interactive Controls: Sliders for velocity, angle, height, and gravity
- Vector Display: Toggle velocity vectors to see components
- Prediction-Based Learning: Students predict before observing
- ๐ Slow Motion Mode: Reduce animation speed for detailed observation
- ๐ Grid Display: Coordinate grid with metric scales
- ๐จ Trajectory Trail: Color-coded path showing projectile history
- โก๏ธ Vector Arrows: Real-time horizontal, vertical, and total velocity vectors
- Point System: Earn points for launches and completions
- Progress Tracking: Track total launches and completed modes
- Statistics: Monitor learning progress with visual stats
- Open
index.htmlin a modern web browser - Select a projectile type (Vertical, Horizontal, or Angled)
- Adjust parameters using the sliders
- Click ๐ Launch to see the motion
- Observe the two-column analysis showing separate horizontal and vertical components
This is a pure HTML5/CSS3/JavaScript application with no dependencies except:
- p5.js library (loaded from CDN)
- Modern browser with ES6 module support
- Chrome, Firefox, Safari, or Edge (latest versions)
Projectiles/
โโโ index.html # Main HTML structure
โโโ README.md # This file
โโโ doc/
โ โโโ DESIGN_PLAN.md # Comprehensive design documentation
โ โโโ Initial plan.md # Original project notes
โโโ src/
โโโ css/
โ โโโ styles.css # All styling (responsive design)
โโโ js/
โโโ main.js # Application controller
โโโ physics.js # Projectile physics calculations
โโโ ui.js # DOM manipulation and UI control
โโโ visualization.js # p5.js canvas rendering
This simulation implements a research-based teaching method that emphasizes:
- Component Separation: Horizontal and vertical motions are calculated and displayed independently
- Color Coding: Blue for horizontal (constant velocity), Red for vertical (accelerated motion)
- Independent Analysis: Each column shows its own equations, velocity, and position
- Visual Integration: Students see how independent motions combine to create parabolic trajectories
- Understand independence of horizontal and vertical motion
- Apply kinematic equations separately to each dimension
- Recognize patterns: horizontal (uniform motion) vs vertical (uniformly accelerated motion)
- Predict and verify projectile behavior through experimentation
- Purpose: Learn basics of vertical motion with gravity
- Controls: Initial velocity only
- Observations: Symmetrical motion, time to go up = time to come down
- Key Concept: vแตง = vโ - gยทt, pure acceleration
- Purpose: Introduce horizontal component
- Controls: Velocity and launch height
- Observations: Horizontal velocity stays constant, vertical accelerates
- Key Concept: Independence of x and y motion
- Purpose: Combine both components with trigonometry
- Controls: Velocity and angle
- Observations: Optimal angle (45ยฐ), component resolution
- Key Concept: vโ = vโยทcos(ฮธ), vแตง = vโยทsin(ฮธ)
- Slow Motion: Check to reduce animation speed by 50%
- Show Vectors: Toggle velocity component arrows
- Show Grid: Display coordinate grid with scale markers
- Show Trail: Enable/disable trajectory path history
- ๐ Launch: Start the animation with current parameters
- โธ๏ธ Pause: Pause/resume during animation
- ๐ Reset: Stop animation and reset to initial state
Horizontal Motion (constant velocity):
- x = vโโ ยท t
- vโ = vโโ (constant)
Vertical Motion (constant acceleration):
- y = yโ + vโแตง ยท t - ยฝgยทtยฒ
- vแตง = vโแตง - gยทt
Component Resolution:
- vโโ = vโ ยท cos(ฮธ)
- vโแตง = vโ ยท sin(ฮธ)
- Gravity: 9.8 m/sยฒ (adjustable)
- Velocity: 20 m/s (range: 0-50 m/s)
- Angle: 45ยฐ (range: 0-90ยฐ)
- Height: 0 m (range: 0-50 m)
Based on Physics Education Research (PER) best practices:
- PhET Design Principles: Implicit scaffolding, productive play, discovery-oriented
- Cognitive Load Theory: Progressive complexity, manageable information chunks
- Visual Learning: Dual coding (text + graphics), color associations
- Active Experimentation: Parameter exploration encouraged
The interface adapts to different screen sizes:
- Desktop (>1024px): Three-column layout with full visualization
- Tablet (641-1024px): Two-column layout, stacked controls
- Mobile (โค640px): Single column, touch-friendly controls
Potential additions (not yet implemented):
- Air resistance toggle with drag coefficient
- Target challenges with accuracy scoring
- Multiple projectile comparison (overlay trajectories)
- Export data for lab reports
- Advanced badges and achievements
- LMS integration (Canvas, Moodle)
- Save/load parameter presets
See /doc/DESIGN_PLAN.md for comprehensive design documentation including:
- Research-based design decisions
- Visual mockups and layouts
- Gamification strategy
- Technical implementation notes
- Educational research references
- Verification: Calculate predictions manually, then test
- Exploration: Vary one parameter, observe effects
- Optimization: Find angle for maximum range
- Comparison: Compare vertical vs horizontal vs angled modes
- Real-World: Connect to sports (basketball, projectile motion in athletics)
- Predict before launch, compare with results
- Explain why 45ยฐ gives maximum range
- Calculate and verify time of flight
- Sketch expected trajectory before running simulation
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Vladimir Lopez
- Physics calculations based on standard kinematic equations
- UI/UX inspired by PhET Interactive Simulations design principles
- Visualization powered by p5.js library
- Educational research informed by Physics Education Research (PER) literature
Built with: HTML5, CSS3, JavaScript ES6, p5.js
Author: Vladimir Lopez | vladimirlopez.org
Purpose: Physics Education - Projectile Motion
Repository: GitHub
You can post your simulator to LinkedIn via a GitHub Actions workflow included in this repo.
- Add two repository secrets (Settings โ Secrets and variables โ Actions โ New repository secret):
LINKEDIN_ACCESS_TOKEN: OAuth access token withw_member_socialscopeLINKEDIN_PERSON_URN: Your LinkedIn person URN, e.g.urn:li:person:XXXXXXXX
- Trigger the workflow:
- GitHub โ Actions โ โPost to LinkedInโ โ Run workflow
- Provide inputs:
message: Your post texturl: The simulator URL (e.g.,https://vladimirlopez.github.io/Projectiles-Simulation-Copilot-version/)
Notes:
- You need a LinkedIn Developer App with Marketing Developer Platform access and the
w_member_socialpermission for OAuth. - The workflow uses
.github/scripts/post-linkedin.mjsto callPOST /v2/ugcPosts.
Alternatively, commit a message file and the post will be created automatically:
- Ensure secrets are set (see above).
- Create or update
.github/linkedin/message.txtwith your desired text and commit tomain. - Optional: update the link in
.github/linkedin/url.txt.
The workflow .github/workflows/post-linkedin-on-file.yml will read these files and post.