determine rotation matrix between 2 sets of unit vectors

280 Views Asked by At

I'm looking for any method which determine rotation matrix between two sets of vectors. For example

R = Va->Vb = Vc->Vd

where:
R - rotation matrix
Vx - unit 3D vectors (X,Y,Z)

Thanks

PS. after some consideration I can see that it's probably unsolvable in farm I currenlty present here where Vb==Vd. Probably I need transformation where after rotating Va to Vb and Vc to Vd then Vb and Vd are equal only on one of three axis. For example (same Z axis)

Vb = [0.0000 -0.7071 0.7071]
Vd = [0.5000 -0.5000 0.7071]
1

There are 1 best solutions below

0
On

You only have the ability to rotate two vectors onto two others if they both are at the same angle with the original two. In that case you could compute that angle using the dot product, $a\cdot b=|a||b|\cos \theta$, and then use the rotation matrix $\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix}$.

In $\Bbb R^n$, if you just had two vectors, then you could use one of the matrices like $\begin{pmatrix}\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\ 0 &0 &I_{n-2}\end{pmatrix}$. But first you would need to compute the angle between the plane spanned by the two vectors and the $x-y$ plane (easy), and rotate the vectors into that plane (can be done with matrices similar to the above, i think).

I suppose the more general version of the problem could be considered pretty interesting ($k$ vectors), and don't know how to solve it off the top of my head. Someone who can do it will probably come along.