# Math Help - Finding Vector after Reflection

1. ## Finding Vector after Reflection

So I have a vector, vector 1, hitting a wall. (This is partially a physics and computer science question, but contains a lot of trig.) This vector has VelocityX and VelocityY. The Normal angle of the wall can be found by a vector pointing to the opposite of the normal angle's direction (we can call this Vector Q). I need the vector hitting the wall to reflect across the normal angle (like a mirror and light).
My attempt was to take Arctan((VelocityY-Qy)/(VelocityX-Qx)) to find the angle of between Vector 1 and Vector Q, then take VelocityX*Cos(angle), and Sin for VelY.
But this didn't work. I tried many variations of this, but I just can't get it perfect.
All help appreciated! Thanks!

2. Since you are given x and y components of the velocity vector, and, I presume, of Q, use the "projection" of the velocity vector on the wall. The projection parallel to the wall does not change while the projection perpendicular to the wall changes sign.

Since the given Q is itself perpendicular to the wall, the projection parallel to Q changes sign and the projection perpendicular to the wall does not change. Do you know how to find projections? If you drop a perpendicular from vector V to vector Q, you form a right triangle with hypotenuse V and "near side" the length of the projection of V on Q- calling the projection vector P, |P|/|V|= cos(\theta) where \theta is the angle between the vectors, so |P|= |V|cos(\theta). But Q\cdot V= |Q||V|cos(\theta) so |P|= Q\cdot V/|Q|. A vector in the direction of Q with length 1 is Q/|Q| so the projection vector itself is (Q\cdot V/|Q|^2)Q. Of course, the vector perpendicular to Q is V minus that: V- (Q\cdot V/|Q|^2) Q.

So V reflected off a wall perpendicular to vector Q is parallel projection minus perpendicular projection: (Q\cdot V/|Q|^2)Q- (V- (Q\cdot V/|Q|^2)Q)= 2(Q\cdot V/|Q|^2)Q- V.

3. That was quite a bit haha.
In your equations are you refering to vector 1 as V? and what is \cdot?
Since for some reason the icons don't show up in your text
thanks though