Collision Response Question

Ok, so I need some help with the math of a collision response. The detection part is finished and works properly - but that's the easy part. The following is a diagram:

Basically the ball has a direction vector of Vector A, and it's going to bounce off of the inside of the circle. I understand that it needs to reflect off the vector drawn between the large circle's origin and the point of collision (Vector B), thus becoming Vector C. I think Vector D gets involved somewhere in the calculations - that's why I've included it.

What's the easiest way to do this? Seems a bit complicated, but I'm sure there's an easy solution to this one... Thanks in advance.

Ok, the Mathematica page looks great - but very confusing to someone who hasn't taken math courses in 6 years.

Will: that explanation looks decent, but I have to wrap my mind around it for a bit. It's important to me that I *understand* this - makes debugging easier. Assuming there is no friction and the bounce is constant, would I use values of 1.0 for each?

And when you suggest to multiply floats by vectors, do you mean simply to multiply the value by both elements of the vector?

Excuse my math skills, or lack thereof. It's been a long time since high school math, and I find this all a bit confusing.

Yes when you multiply vectors by floats just multiply both elements of the vector. A bounce of 1 and the ball never stops bouncing. A bounce greater than 1 and it gets exponentially faster until something goes wrong.

The maths above splits the balls velocity vector into two orthogonal components, one along the vector B perpendicular (pp) to the collision point, and one along the vector D parallel (p) to the collision point. It is easy to then combine these back to get the reflection vector.

Technically it is not a cross product. Cross-products are only between vectors. It is just a multiply. So yes just multiply each of B's components by the scalar. So (A â€¢ B) Ã— B is just: B scaled to the magnitude of the dot product of A and B.

Quote:Wow, thanks Will! Great diagram - what did you use to make it? I grow quickly tired of Sketch.app!