2

Given a point $P = [x, y, z]$ and a vector $v = [v_x, v_y, v_z]$

I want to move the point along the vector by a fixed amount $d$

Thank you

1 Answers1

2

To move a point along a vector, we multiply the vector by a constant ($\epsilon$), and then add it to the point $P_{moved} = P + \epsilon v = [x + \epsilon v_x, y + \epsilon v_y, z + \epsilon v_z]$

Now, the distance moved $d = \sqrt{(P_{moved} - P)^2} = \epsilon\sqrt{v_x^2 + v_y^2 + v_z^2}$

Therefore $\epsilon = \frac{d}{\sqrt{v_x^2 + v_y^2 + v_z^2}}$

So $P_{moved} = P + \frac{d}{\sqrt{v_x^2 + v_y^2 + v_z^2}}v$