# Thread: How to determine rotation and translation between v1 and v2

1. ## How to determine rotation and translation between v1 and v2

Hi all,

Say I have two 3D vectors, v1 and v2.
How do I determine the rotation and translation that is needed to go from v1 to v2?
I know the 4D rotation/translation matrix. But I see no way to solve these equations with just the v1 and v2 as known.

I actually have 2 points that move in 3D space. The two points that define the vectors are linked together in that they always are at the same distance from each other. So it's like a stick in 3D space and I would like to follow the two end points in terms of (x,y,z) translation and yaw, pitch, and roll, but I only know that starting vectors (at t=0) and the end vectors (at t=1).

Thanks all,

Marco

2. Does your 4D matrix have bottom row (0,0,0,1). (It probably should do). If so I'd suggest that the upper left 3*3 minor is the rotation matrix and the (1*3) column vector to the right is the translation.
At any rate, applying that matrix as a linear transformation and then translating by that amount would be equilvalent to your 4D transformation.

You might want the rotation about the centre of the stick. In that case conjugate your matrix by the translation that sends the centre of the stick to the origin.

Apologies if I've totally misunderstood your question.

3. Hi,
Yes the basic matrix is in order (I hope :-).
And I think I understand how it works. The problem is that I do not know the rotation or the translation. That is what I would like to find out having only the two vectors to P1 and P2 before and after the rot/trans.