   Vector reflecting
  So i've been bored in school and decided to fool around with XNA due to the release of the windows phone. I've been following a PDF of a book that covers basic things with XNA but when i stray from that is where i start to encounter problems. Anyways, back to the problem. I have two sprites(in this case, two balls) that go from predetermined spots back and forth. My goal is to just have them bounce around the screen(targeted for Windows phone) by themselves infinitly. So what needs to be done is have each individual ball "bounce" off the edges at the angle they hit it at, but i have no idea how to do the math behind it. I've looked into the atan2(,) method but i dont know if what i've passed into it is really what needs to be since the answer seems to be illogical by my conclusions/understanding. i can post code/clarify questions if need be.tl;dr version, how do you calculate the angle of a vector path and reflect it by the x/y axis when it hits a vertical/horizontal edge respectivelyI do not have a strong math background, but i understand most basic concepts if it's explained well enough.   
  If you're talking about a simple rectangle, then the "collision" will be with either a vertical or horizontal edge and you don't need any fancy math.Given a 2D direction vector (x,y):If it hits a vertical edge, the new direction is (-x,y).If it hits a horizontal edge, the new direction is (x,-y).;  You don't need to use angles for this. For the general solution, just search for 'vector reflection' and you should find the equation for reflecting one vector relative to another (in this context, the first vector would be the velocity vector, and the second would be the normal of the surface in question).Note that for axis-aligned (e.g. horizontal and vertical) surfaces, this reduces to simply negating the appropriate element of the velocity vector. For example, if the object is bouncing off a vertical surface (assuming a standard XY coordinate system), you'd simply negate the x element of the velocity vector. [Edit: Like Buckeye said.]   ;  To reflect a direction vector by a plane aprouch would be like this1- add intersection point with normalized ball path vector = results vector O2- mirror O point by the plane (to flip a point by a plane you compute distance of the point from plane and multiply normal of the plane with 2*distance scalar and add this vector to original point) = results V3- subtract V from intersection point and normalize = this is normalized new direction vector.   ;  So i fixed the problem, but now i'm trying to implement collision detection with the other sprites. I added boundingboxes to both the sprites but when i use their Intersects method that only allows me to change both the X or Y paths of the sprites. Is there a way to check which side of the sprite overlaps with the boundingbox or will i have to abandon it and write something?   