Hooman's Portfolio  
 Contact  
 Hootris  
 Dinky Chase  
 Hooman to Eves  
 Eves To Hooman  
Physics - Elastic Collision in 1D ActionScript 3.0

Two Balls Colliding in One-Dimension

This is a demo I created to experiment with physics and collisions between two objects. Use the slider and number box below to change the mass or speed of each circle. Click on "Go" to watch them collide.


Special thanks to Isaac Newton for making this demo possible

Some Notes About This Demo

An elastic collision is a collision where the total momentum of the objects colliding are preserved. In other words, none of the energy involved in the collision is converted to heat, friction or other forms of energy. While the speed of each object may change, the total amount of kinetic energy of the objects remain the same before and after the collision. All we are concerned with is how the two colliding objects effect each other's movement.

In order to calculate the collision, we want to keep track of how heavy each object is and how fast they are travelling. For example, if a large truck crashes into a small car, the car will go flying while the impact may barely effect the truck's course of travel. On the other hand if a car is driving quickly and hits a truck, that truck will move much more than if the car was driving slowly.

To accurately emulate such collisions, I had to use two physics equations:

m1u1 + m2u2 = m1v1 + m2v2

and

½m1u12 + ½m2u22 = ½m1v12 + ½m2v22

where:

m1 = mass of object 1
u1 = initial velocity of object 1
v1 = final velocity of object 1
m2 = mass of objet 2
u2 = initial velocity of object 2
v2 = final velocity of object 2


What we're interested in is finding the final velocities (i.e. the values of v1 and v2). This gives us two equations and two unknowns, so with a little algebra we get:

v1 = u1(m1 - m2) + 2m2u2       
m1 + m2


Check this entry in wikipedia to see more explanations on all the physics and math involved in computing the collision.

Latest Work:

Applications
Content Management System
Local Developer
Manager's Advantage
Manager's Advantage Support

Games • ActionScript 3
Hootris
Dinky Chase (not finished)

Demos • ActionScript 3
Loading and Saving XML
Physics - 2D Collision
Physics - 1D Collision
Scroller
Filters Demo
Transition Demo
Tween Demo
Psychedelic Stage Light
Video Player
Hotdog Guitar
Filters and Gradients
Keyboard Demo
Hello World
Simple Button

Previous Work:

Applications • Turbo Pascal
Map Editor
Master GFX 16
Hooman's File Manager

Games
Stone Bringer
The Original Hootris

Demos • C++ / DirectX
Fish