# Length of Perpendicular/Parallel Vectors

Knowing the two vectors in black, and the point x,y at the end of the two red vectors.

I'm having trouble figuring out a formula to get the perpendicular/parallel vectors represented in red in order to calculate their lengths.

My end goal is to figure out the ratio of length between one of the black vectors and its parallel red vector passing through the point x,y

[EDIT] It would be great if the solution is in terms of x,y coordinates and was solved from three sets of points, the x,y point represented then the two end points of the black vectors

-

Your diagram may be somewhat misleading in that the point $x,y$ seems to lie halfway between the tips of the two black vectors. If that were the case, then the ratio would trivially be $2$. Also, it's not clear (to me) what you're referring to as "perpendicular", since there are no right angles in the diagram.

For general position of $x,y$, you can find two vectors parallel to the two black vectors that add up to $(x,y)$ by solving a linear system of equations:

$$a\vec v+b\vec w=\vec x\;,$$

where $\vec v$ and $\vec w$ are the two black vectors, $\vec x=(x,y)$, and $a$ and $b$ are parameters to be determined by solving the resulting $2\times2$ system of equations. The two desired vectors are then $a\vec v$ and $b\vec w$.

[Edit in response to the comment:]

If we denote the components of the black vectors by $(x_1,y_1)$ and $(x_2,y_2)$, respectively, the above linear system of equations becomes

$$\begin{eqnarray} ax_1+bx_2&=&x\\ ay_1+by_2&=&y\;. \end{eqnarray}$$

This can be solved explicitly using Cramer's rule:

$$a=\frac{\left|\begin{array}{cc}x&x_2\\y&y_2\end{array}\right|}{\left|\begin{array}{cc}x_1&x_2\\y_1&y_2\end{array}\right|}=\frac{xy_2-x_2y}{x_1y_2-y_1x_2}\;,$$

$$b=\frac{\left|\begin{array}{cc}x_1&x\\y_1&y\end{array}\right|}{\left|\begin{array}{cc}x_1&x_2\\y_1&y_2\end{array}\right|}=\frac{x_1y-xy_1}{x_1y_2-y_1x_2}\;.$$

Then the components of the two red vectors are $(ax_1,ay_1)$ and $(bx_2,by_2)$, respectively (where $a$ and $b$ are determined as above).

-
Thank you very much for this, is there a possibility you could list the solution based on x,y coordinates, where i have the x,y coordintates of each of the black vectors and the point I want to solve for? I not having much success converting the points i have into the mathematical representation of vectors –  Tristan Jul 16 '11 at 17:02
I edited the answer. I hope this is what you need -- I'm not sure I understand the distinction between coordinates and "the mathematical representation of vectors" that you're making. –  joriki Jul 16 '11 at 17:49
Admittedly very nitpicky, but if you're using $|\cdot|$, there's no need for $\det$, no? :) –  Guess who it is. Jul 16 '11 at 17:56
@J. M.: You're quite right -- at first I used parentheses, then I thought it looked weird, and I checked the Wikipedia article, wondered why the notation should be so redundant, and then copied it mindlessly :-) –  joriki Jul 16 '11 at 18:09
I've corrected the notation in the Wikipedia article. –  joriki Jul 18 '11 at 4:57