# Thread: Opposite Movement in a 2D Space...

1. ## Opposite Movement in a 2D Space...

Hello, I'm new here and I always will be new in maths (as well as in English...)

Well, the case is I'm treating to make a script for a 2d animation program and I need a way to make a point moving in the opposite way of another one, I mean when point A moves to right, point B moves to Left, and if point A moves to top, point B moves to bottom. If I'd want that one point moves in the same direction than another one, I'd only have to link his point.x and point.y coordinates, but to obtain the opposite movement I need some 2d vector math operation to calcule it and, as I said, I'm totally lost here and, although I know that it seems like a very simple vector operation, as soon as X and Y coordinates are involved at the same time I make a mess...

Well, I hope be writing this in the correct sub-forum and had been clear enough... THANKS for any help!

2. Let the point A be represented by $\displaystyle (a_1,a_2)$and B by $\displaystyle (b_1,b_2)$

then if A moves in the direction (x,y) the new coordinate for A will be $\displaystyle (a_1 + x,a_2 + y)$ then the new coordinate for B will be $\displaystyle (b_1-x,b_2-y)$

3. Thank you very much! I'm working in a lua script for a 2D animation program and I'm trying to collect the enough info to get it works, there are too many things (now I'm treating to understand Matrices ), but this is a very important part.

Well, I hope can make it works soon! And, if I get it, I'll thank you again here when I know it, bye!