1
$\begingroup$

enter image description here

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

1 Answers 1

7

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).

  • 0
    I've corrected the notation in the Wikipedia article.2011-07-18