Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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|cite|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. – kravemir Oct 8 '11 at 10:24
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|cite|improve this answer
Thanks. It's so simple :) What application have you used to create picture? – kravemir Oct 8 '11 at 10:29 – 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.