Elastic Collisions Physics Simulator

Generates random circles with random momenta that bounce off the walls and each other.

Keep Clicking Inside the Box to See What Happens

This feature requires a modern web browser. This element is intended to contain the collisions simulator.
Launch Zen Mode →

About the Elastic Collisions Physics Simulator

Welcome to the interactive Elastic Collisions Physics Simulator, a web-based environment designed to demonstrate 2D elastic collisions and momentum transfer in real time. By utilizing the HTML5 Canvas API and vanilla JavaScript, this application renders a continuous, high-framerate physics engine directly within your modern web browser without the need for external plugins.

How the Physics Engine Works

When you click inside the simulation box, the program generates a new circular entity with a randomized mass and initial velocity vector. As these circles traverse the bounded environment, the algorithm continuously calculates their positions and detects overlaps. Upon contact, the program calculates an elastic collision, accurately transferring kinetic energy and momentum between the objects based on their respective momentum vectors. The result is a mathematically accurate, chaotic, and visually satisfying demonstration of classical physics.

Instructions for Use

To interact with the simulator, simply click or tap anywhere inside the box above. Each click spawns a new circle into the active environment. You can spawn a few objects to observe simple trajectory changes and wall bounces, or you can rapidly click to fill the space and watch how a high-density environment affects the overall kinetic energy and object clustering. This tool serves as both a relaxing visual fidget application and a practical demonstration of JavaScript-based physics calculations.