Rotating Vectors in space
I think you want a single transformation function for all points, rather than one for each point independently as kglr's answer currently shows.
set1 = {A0, A1, A2, A3};
set2 = {B0, B1, B2, B3};
tF2 = FindGeometricTransform[
set1, set2
, TransformationClass -> "Rigid"
, Method -> "FindFit"
][[2]];
Graphics3D[{
{Red, PointSize[Large], Point[set1]},
{Opacity[.15, Blue], Sphere[tF2@set2, 2]}
}]
If you are looking for a map R.A[i]~B[i] ,i,0,1,2,3
:
First you have to define the rotationmatrix R
ϕ = {{0, -φ3, φ2}, {φ3,0,-φ1}, {-φ2, φ1, 0}};
φ = Simplify[Sqrt[Tr[-ϕ.ϕ/2]]]
R = IdentityMatrix[3] + Sin[φ]/φ ϕ + (1 - Cos[φ])/φ^2 ϕ.ϕ ;
which depends on φ1, φ2, φ3
Now you can calculate the optimal rotation parameters φ1, φ2, φ3
J = Total@MapThread[(R.#1 - #2 ).(R.#1 - #2 ) &, {{A0, A1, A2, A3},{B0, B1, B2, B3}}]
sol=NMinimize[J, {φ1, φ2, φ3}]
(* {2061.5, {φ1 -> -1.01538, φ2 ->1.45343, φ3 -> 1.3975}} *)
The optimal rotationmatrix is
Ropt=R /.sol[[2]]
(*{{-0.303462, -0.951876, 0.0429177},
{0.00554758, 0.043276,0.999048},
{-0.952827, 0.303411, -0.007852}} *)
Ropt.Transpose[Ropt] (*test: should be identitymatrix[3] *)
You can use FindGeometricTransform:
tFs = MapThread[FindGeometricTransform[{#}, {#2}][[2]] &,
{{A0, A1, A2, A3}, {B0, B1, B2, B3}}];
Graphics3D[{Red, PointSize[Large], Point[{A0, A1, A2, A3}], Opacity[.15, Blue],
MapThread[Sphere[#@#2, 2] &, {tFs, {B0, B1, B2, B3}}]}]