Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

share|improve this question
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

1 Answer 1

up vote 1 down vote accepted

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:


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$

enter image description here

share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.