Reconstructed rotation matrix is not the same as the original one

classical-mechanicskinematicsmatricesmatrix-calculusrotations

I need a little help.

I rotated the vector $s$ using the rotation matrix $R$ and got a new vector $S$.

Now I want to reconstruct the rotation matrix from vectors $s$ and $S$ using the Rodrigues formula.

https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula See Matrix Notation

The algorithm is standard: I calculate the angle between the vectors $\theta$, the axis of rotation $k$ and the rotation matrix $Q$ using the Rodrigues formula.

enter image description here

Resulting matrix $Q$ does not match the original one $R$. Why? Am I wrong somewhere?

Best Answer

Given two vectors $s$ and $S$, there are multiple rotations taking $s$ to $S$. given $R$ such that $Rs=S$, we can choose any rotation $R'$ such that $R's=s$ and $RR'$ will also satisfy $(RR')s=S$.

More information is needed to uniquely determine the original rotation.

Edit: determining $R$ from two pairs of vectors

First, note that the cross product $\times$ is preserved up to sign by rotations: $$ R(u\times v)=\begin{cases} (Ru)\times(Rv) & R\text{ is a proper rotation} \\ -(Ru)\times(Rv) & R\text{ is an improper rotation} \end{cases} $$ Suppose we have vectors $s,t,S,T$ with $s,t$ linearly independent and we know that $Rs=S$ and $Rt=T$ for some rotation $R$. Since $s,t$ are linearly independent, $s,t,s\times t$ forms a basis for $\mathbb{R}^3$. The same is true of $S,T,S\times T$, since rotations preserve liner independence. Thus we have $$ R[s,t,s\times t]=[S,T,\pm S\times T] $$ where $[u,v,w]$ is the matrix whose columns are vectors $u,v,w$. Since bases form invertible matrices, we have $$ R=[S,T,\pm S\times T][s,t,s\times t]^{-1} $$ where choosing $+$ will give a proper rotation and choosing $-$ will give an improper rotation.

Related Question