I am given a $3$D vector $v=[x,y,z]$ and an amount I want to move it, by some constant say $c=5.$

48 Views Asked by At

Say I am given a 3D vector $v = [x,y,z]$ and an amount I want to move it, some constant say $c = 5$. I would like to move the vector in the direction it is pointing (or oriented).

Is there a simple equation for doing this?

Originally I thought one could just do $[x+c, y+c, z+c]$ but ostensibly this would move the vector regardless of its orientation. I want to move it only relative to the orientation, the place it is pointing.

1

There are 1 best solutions below

2
On BEST ANSWER

Assuming that what you're looking for is how to move the point in a plane, that your vector is pointing at in relation to the origin of your coordinate system:

You have to add your vector plus a vector in the same direction with length $c=5$

$$\vec{r_{new}} = \vec{r_{old}} + c\cdot\vec{e_r} = \left(\begin{matrix} r_x \\ r_y \\ r_z \\ \end{matrix}\right) + c\cdot\frac{1}{\sqrt{r_x^2 + r_y^2 + r_z^2}}\cdot\left(\begin{matrix} r_x \\ r_y \\ r_z \\ \end{matrix}\right)$$

Here, $\vec{e_r}$ is called the unity vector (length 1) in direction of $\vec{r}$, which is how it's normally used. The trick is that the length of the vector you multiply $c$ by, has to have length 1. If you're not sure how that works, just try to calculate the length of $\vec{e_r}$.

Also, in physics and maths, when you use a vector to describe the location of a point in a coordinate system, you usually use the letter $r$, as in the radius from the origin.