# How to scale vector to touch the line between two other vectors?

I have three vectors:

• $A(a_0,a_1)$
• $B(b_0,b_1)$
• $V(v_0,v_1)$

I need to scale the $V$ vector to touch the line between $A$ and $B$.

You can be sure that $V$ vector points between $A$ and $B$.

-
What is your question? (Is this homework? Do you have any work to show?) –  Henning Makholm Oct 7 '11 at 18:36
No, it's not homework and don't have any trouble with homework, i'm best at math in my class :) It's part of bigger problem, but we've learned only few thing from geometry in school yet. –  Miro Oct 8 '11 at 10:24

I will assume that first vector is $\vec {OA}=a_0\vec i+a_1\vec j$, second $\vec {OB}=b_0\vec i+b_1\vec j$, and third $\vec {OV}=v_0\vec i+v_1\vec j$, where $\vec i$ and $\vec j$ are unit vectors.

Let's observe picture bellow.You can see that point $A$ and point $B$ lies on line which is defined by next equation:

$y-a_1=\frac{b_1-a_1}{b_0-a_0}(x-a_0)$

Since end point of vector $\vec {OV}$ needs to touch line between $A$ and $B$ point $(v_0,v_1)$ must satisfy equation of the line,so we can write following:

$v_1 =a_1+\frac{b_1-a_1}{b_0-a_0}(v_0-a_0)$,

You can choose arbitrary value of $v_0$ between $a_0$ and $b_0$ in order to calculate $v_1$

-
Thanks. It's so simple :) What application have you used to create picture? –  Miro Oct 8 '11 at 10:29
geogebra.org/cms –  pedja Oct 8 '11 at 10:44