Vector Algebra Related

You have a point in space having known coordinates, say P(x1, y1, z1). There is a vector coming out of this point in the direction, D(ai + bj + ck), write pseudo code to find the coordinates of an another point Q in the given direction at distance d from our originating point.
P + (d / ||D||) D
 
@ d
Let us consider an example:
let P = (1,2,3)
D = 3i+2j+7k
d=5
then,
(x,y,z) = (1,2,3) + (5/sqrt(62)) * (3,2,7)
let (5/sqrt) = m
(x,y,z) = (1+3m, 2+2m, 3+7m) Answer.
Is that correct?
Or are you using some other norm, I have used sqrt of sum of squares here.

你可能感兴趣的:(vector,distance)