Inge Söderkvist (2009) has a nice write-up of solving the Rigid Body Movement Problem by singular value decomposition (SVD).
Suppose we are given 3D points $\{x_1,\ldots,x_n\}$ that after perturbation take positions $\{y_1,\ldots,y_n\}$ respectively. We seek a rigid "motion", i.e. a rotation $R$ and translation $d$ combined, applied to points $x_i$ that minimizes the sum of squares of "errors":
$$ \sum_{i=1}^n || Rx_i + d - y_i ||^2 $$
Think of the points $x_i,y_i$ as columns, and of rotation $R$ as a $3\times 3$ orthogonal matrix. Strictly speaking we require $\det(R)=1$ because as a continuous motion a rotation preserves the "orientation" of the points, i.e. will not involve reflecting them.
The first step is to subtract off the respective means $\overline{x},\overline{y}$ from points $x_i,y_i$, which has the effect of "eliminating" (for now) the unknown translation $d$. That is, the problem becomes:
$$ \min_{R\in SO(3)} || RA - B ||_F $$
where $A = [x_1 - \overline{x},\ldots,x_n - \overline{x}]$ and $B = [y_1 - \overline{y},\ldots,y_n - \overline{y}]$. Here $SO(3)$ denotes the special orthogonal group of rotation matrices in 3D we are allowed to choose $R$ from, and the matrix norm $F$ here denotes the Frobenius norm, i.e. the square root of the sum of squares of matrix entries (like a Euclidean norm, but on matrix entries).
Now $A,B$ are both $3\times n$ matrices. The minimization above is an orthogonal Procrustes problem allowing only rotation matrices. The solution $R$ is given by taking the singular value decomposition of the "covariance" matrix $C = BA^T$:
$$ C = U S V^T $$
where $U,V$ are orthogonal matrices and $S = \text{diag}(\sigma_1,\sigma_2,\sigma_3)$ is the diagonal matrix of singular values $\sigma_1 \ge \sigma_2 \ge \sigma_3 \ge 0$. Numerical linear algebra packages like Matlab and Octave will compute the SVD for you.
Once we have the SVD, define $R = U \text{diag}(1,1,\pm 1) V^T$ where the sign in the middle factor is chosen to make $\det(R) = 1$. Ordinarily a real world application will have $\det(UV^T) = 1$, and thus the sign chosen would be positive. If not, it means the best orthogonal (distance preserving) fit to the new points involves a reflection, and it suggests checking the data for mistakes.
Finally we define the translation $d = \overline{y} - R\overline{x}$. Done!
The variant of orthogonal Procrustes problems where only rotations are allowed is also the subject of another Wikipedia article on the Kabsch algorithm. Notation in the Wikipedia articles differs from ours in multiplying by $R$ on the right, rather than (as here) on the left.