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
2009-04-16 15:03:33
+2
A:
Multiply the vector by the distance then add the resulting vector to the point.
Pedro Daniel
2009-04-16 15:03:33
+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
2009-04-16 15:05:32