A closed form solution exists for this task. It can be computed in O(n)
time (Umeyama, 1991 [12]).
The problem is related to the well known Procrustees problems in statistics
and involves eigenvalue analysis of a correlation matrix of the points.