Jeremy Nally

Physics Collisions Simulator

Generates random circles with random momentum 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.

About the Physics Collisions Simulator

Welcome to the interactive Physics Collisions 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 engine generates a new circular entity with a randomized mass, initial velocity vector, and trajectory. As these circles traverse the bounded environment, the algorithm continuously calculates their position and detects overlap. Upon contact, the engine calculates an elastic collision, accurately transferring kinetic energy and momentum between the objects based on their respective angles and speeds. The result is a mathematically accurate, chaotic, and visually relaxing demonstration of kinetic physics.

Instructions for Use

To interact with the simulator, simply click or tap anywhere inside the primary bounding box. 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 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.