I have two fixed frames A and B. I have a mobile point P for which I know the 3D orientation (in terms of unit direction vectors) wrt A and B at each time step.
I need to find the Rotation Matrix from B to A.
I checked other answers (e.g. Expression of rotation matrix from two vectors, Calculate Rotation Matrix to align Vector A to Vector B in 3d?), and I'm able to find a rotation matrix R.
But I don't understand why this matrix R changes when the orientation of point P changes. Shouldn't it be fixed since A and B are fixed frames, regardless of P orientation?
EDIT:
Example: B is a frame rotated of -$\pi$/4 on the Y (green) axis wrt to A. If I have the following direction vectors:
$v_a = [-1, 0, 0]; v_b = [-0.70, 0, 0.70]$
Using the procedure in Expression of rotation matrix from two vectors I get this rotation matrix:
$R=\begin{bmatrix}0.70&0&-0.7\\0&1&0\\0.70&0&0.70\end{bmatrix} $
But when the rigid body P turns and for example I have the following direction vectors:
$v_a = [-0.866, 0.5, 0]; v_b = [-0.61, 0.5, 0.61]$
I get the following:
$R=\begin{bmatrix}0.83&-0.04&-0.55\\0.22&0.94&0.26\\0.51&0.34&0.79\end{bmatrix} $