12

I have a 3D vector u defined through two points A (0/2/0) and B (3/3/3).

u        = [3/1/3]  
u.length = sqrt(3²+1²+3²) = 4.24...

How can I get a new vector v with v.length = 1.5 which has the same origin A and direction as u?

VoidCatz
  • 455

2 Answers2

17

In general, if you have a vector $\bf v$, and you want another vector in the same direction, with a given length $L$, then the vector: $${\bf u} = \frac{L}{\|{\bf v}\|} {\bf v}$$ does the job, because: $$\left\|{\bf u} \right\| = \left\| \frac{L}{\|{\bf v}\|} {\bf v} \right\| = \frac{L}{\|{\bf v}\|} \|{\bf v}\| = L $$

Ivo Terek
  • 77,665
0

Don't forget to add in the coördinates of the origin.

$\left[{9\over{2\sqrt {19}}}/{{3+4\sqrt {19}}\over{2\sqrt {19}}}/{9\over{2\sqrt {19}}}\right]$