tags:

views:

203

answers:

3

I have a unit vector, a distance and a coordinate and I would like to calculate the new coordinate given by adding the distance onto the coordinate in the given direction. How do I do this?

+1  A: 

If with a unit vector, you mean a vector with distance 1. You can find the coordinate bij multiplying all coordinates with the distance.

V = V unit * distance


V unit = (1/2 sqrt(3), 1/2)
distance = 6

==>

V = (3 sqrt(3), 3)
Gamecat
+2  A: 

Multiply the vector by the distance then add the resulting vector to the point.

Pedro Daniel
+1  A: 

Here's some pseudocode, assuming you're using Cartesian coordinates.

new_coord.x = distance * unit.x + coord.x
new_coord.y = distance * unit.y + coord.y
kvb