translate vector

Started by
2 comments, last by giugio 8 years, 7 months ago

hello i have a vector V v1 v2 and i would translate to the points a a1 a2.

How i can do that?is a simple translation? the direction must be the same for the vector v and vector a.thanks

Immagine.png

Advertisement

hello i have a vector V v1 v2 and i would translate to the points a a1 a2.

How i can do that?is a simple translation? the direction must be the same for the vector v and vector a.thanks

Sorry but I don't understand the question or the picture.

You're working in 2D, and you have a vector V, where V = (v1, v2) ? that is, v1 and v2 are the elements of V? Ok, I think I got that right.

"points a a1 a2" means you have 3 points (point a, point a1, and point a2), or one point 'a', where a = (a1, a2)? but then "points" is wrong in your post. I tend to believe you intend the latter, but not sure.

In the second sentence you speak about vector v rather than V. I assume it's a typo.

With "vector a" you lost me, a was a point, right?

The drawing drawing doesn't add much for me. Where is point a in the drawing? where is vector v? What is your translation vector?

You write "I would translate to the points ..." but from what point to what point? or is V the translation vector?

Then again you write "direction must be the same for the vector v", so perhaps V is not the translation vector?

And then I was fully lost :(

Anyway, a vector is a direction, and doesn't change under translation (just like north stays north even if you move to the other side of the street)[1]

A point gets translated by adding the translation elements to its coordinates.

[1] Ignoring that the earth is a sphere, and thus Euclidean geometry doesn't really apply.

IMO: What the OP essentially has is a line segment v between v1 and v2, so that

v( k ) := v1 + k * ( v2 - v1 ) w/ 0 <= k <= 1

where v1 and v2 are position vectors ("points") and hence ( v2 - v1 ) is a difference vector (like a direction vector with not necessarily unit length).

That line segment should be shifted to be a line segment a between a1 and a2, so that

a( k ) := a1 + k * ( a2 - a1 ) w/ 0 <= k <= 1

under the condition that the directions are the same, hence
v2 - v1 == f * ( a2 - a1 )
for an arbitrary scaling factor f.
A translational shift s is a difference vector and has an effect on position vectors / points, so that you want
v1 + s = a1
Hence s and f can be calculated due to the given conditions.

thanks heagarr i would use this for the camera, the vector can be everywhere and i take a vector in runtime and switch it to the center as if the user click in the center and drag a direction but with the same direction.
the my direction can start everywhere but is shifted to the center and take the phi and the theta from a vector that is at the center.
so I think i can concatenate the correct rotations.
Thanks.

This topic is closed to new replies.

Advertisement