Bouncing Balls

Time for a bit of Physics and Math!

(Yikes, I hate both of those evil things - I heard some of you say!)

Well, sorry, but math is good for you, and physics helps us understand how our world works! We need both of this things to figure out what happens when two balls collide!

Velocity Vectors

We are going to keep this simple, Our balls are two-dimensional gadgets, moving in a plane with X and Y axes. Each ball has a velocity measured by the change in its position along the X axis during some unit of time, and the corresponding change in its position along the Y axis during the same unit of time.

We call the distance moved divided by the unit of time the speed of the ball.

The actual velocity of the ball is vector quantity, meaning is has both magnitude and direction. We can use a bit of trigonometry to figure out the X velocity (V_x) and the Y velocity (V_y)if we know the total velocity (V_{tot}) and the direction of the movement (:math:alpha`) measured counterclockwise from the X axis. .

Here are the equations we use to figure out the Vx nd Vy velocities:

V_{1x} = V_{tot} * cos(\alpha)

V_{1y} = V_{tot} * sin(\alpha)

A little math will show that:

V_{tot} = \sqrt{{V_{1x}}^2 + {V_{1y}}^2}

the vector sum of the speed along those two axes.

Coordinate Transformations

Suppose we lay another coordinate system on top of our drawing coordinate system, and rotate that new system by some angle (:math:phi). In this new system, we can figure out the velocity components with a bit more trigonometry!

Warning

This can get ugly!

V_{2x} = V_{tot} * cos(\phi)

V_{2y} = V_{tot} * sin(\phi)