I need to know how to find a vector opposite to another, but the second vector is not necessarily the same magnitude as the first, but the direction is opposite. Ex:
I made a small diagram 🙂
alt text http://img688.imageshack.us/img688/5394/prettydiagram.png
Basically if I have the coordinates of A(-150,150) and I want B to be opposite, and have a magnitude of only 2, I would want to obtain B(-200,-150). What I am doing is making an application that can draw cubic bezier shapes and I noticed with lots of these, there are bezier handles and modifying one handle cause the other one to move too. How could this be done?
Thanks
It is simple, really.
B = -1/2 * A, orB.x = -1/2 * A.x,B.y = -1/2 * A.y,B.z = -1/2 * A.z. This talks about vectors, btw. You would want to shift the result. The formula is dead-simple. What am I missing?EDIT
Your app knows the red dot location (let’s abbreviate it as R vector). Your app also knows the A vector. It needs to find the B vector that is on the same line as AR, on the other side of R as A, and such as A is twice as far than B. Well, in that case:
V = (A - R)B = R - 0.5 * V.It is that simple, I promise. The capital letters represent vectors, which are generally 2-tuples or 3-tuples of real numbers (depending on whether you work in 2D or 3D).
There is not much to this, really. Any questions?