Please enable JavaScript to use CodeHS

Exploring Collisions in Physics

Students will use JavaScript graphics to create their own elastic collision simulation using conservation of momentum and kinetic energy equations. This course is designed for students who have taken or are taking a physics course and have a background in solving algebraic equations. The approximate length of this course is 2-4 hours.

By the Numbers

Contact Hours 3
Lessons 6
Videos 6
Exercises 7
Offline Handouts 2


Unit Description
Exploring Collisions in Physics: Explore how simulations are used in research by creating your own elastic collision simulation! You will use JavaScript graphics to create objects on a canvas and then use conservation of momentum and kinetic energy equations to study how mass and speed affect the final speeds of each object.


Click on a demo to test it out.

Adding Movement to the Balls

Creating an Inelastic Collision

Creating an Elastic Collision


Here are a few examples of teacher resources and materials to use in the Exploring Collisions in Physics course

Format of Course

The entirely web-based curriculum is made up of a series of learning items that introduce students to some fundamentals of programming. Each lesson is made up of short video tutorials, example programs, and programming exercises. The course is designed as an integrated, 2-4 hour long mini-unit, though schools implement it in a variety of ways.

Who is it for?

The Exploring Collisions in Physics mini-unit is designed for complete beginners with no previous background in computer science, though they should have some knowledge of algebra and basic understanding of the physics of moving bodies. The course is highly visual, dynamic, and interactive and should be used with high school math students.


Interested in teaching the Exploring Collisions in Physics mini-unit with CodeHS? Get in touch, so we can help you bring CodeHS to your school!

Bring to My School