I'm coding a simple Flash game, just to learn flash and improve my maths, but I'm getting very confused with Radians as there are new to me.
What I've done so far is using your mouse you (click & release) you shoot a ball off in that direction using radians. Now what I'd like to happen is when the ball hits the wall it bounces off in it's reflection angle. Eg. if the ball hits the right-hand-side wall travelling at in a radians of -0.65 it should bounce back in the radians of about -2.5
Could some please explain to me how I go about doing this?
Thanks
Best Answer
The relevant quantity here is the velocity vector of the ball. When you hit a wall, you want to flip the component of that vector perpendicular to the wall and keep the other component equal.
So, if you fix a velocity vector by giving an initial speed $v_0$ and a direction given by an angle $\alpha$ with respect to the horizontal direction and assuming there are only horizontal end vertical walls, this is what will happen: