Rotation + Translation of vectors I have two sets of three intersecting orthogonal vectors, with direction vectors: $\vec{X}$, $\vec{Y}$, and $\vec{Z}$. Each set has a different intersection point (point $A$ and point $B$). Also, none of the vectors are parallel to another.
If I know all the direction vectors and intersection points coordinates, how do I translate and rotate one set to another (say, $A$ to $B$)? In other words, what is the function $\,f(\cdot)$ for this transformation?

 A: For the transformation from $A$ to $B$ the best  method to describe it, is to use homogeneous notation.
You can write a position and orientation of the frame $A$ in a base $0$ frame as
${^0}H_A= \begin{bmatrix}
\vec{X_A} & \vec{Y_A} & \vec{Z_A} & \vec{A_A} \\
0 & 0 & 0 & 1
\end{bmatrix}$ where 
$A_A= \begin{bmatrix}
{A_x}   \\
{A_y}   \\
{A_z}   
 \end{bmatrix}$,   
and frame B in the same base frame as
${^0}H_B = \begin{bmatrix}
\vec{X_A} & \vec{Y_B} & \vec{Z_B} & \vec{B_B} \\
0 & 0 & 0 & 1
\end{bmatrix}$ where 
$B_B= \begin{bmatrix}
{B_x}   \\
{B_y}   \\
{B_z}   
 \end{bmatrix}$.
Now you have transition from $0$ to $A$ and from $A$ to $B$  denoted as ${^0}H_A{^A}H_B={^0}H_B$ and then ${^A}H_B=({^0}H_A^{-1}){^0}H_B$ what gives the wanted solution.
A: https://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-orientation-horn-s-method?
The algorithm in this website gives me the transformation matrix for this question. The matrix is just an estimate but I believe this method would be useful for problems that are more complex than this question.
