Calculate rotation on a sphere with given coordinates I have a sphere with a fixed radius. 
I have a set of points on that sphere, let's say $p_1, p_2$ and $p_3$ and it's $3$D Cartesian coordinates.
I rotated each of the points around the center of the sphere with the rotation matrix $M$ and get the set of $p_{1r}, p_{2r}, p_{3r}$ cartesian coordinates. 
How can I calculate the matrix $M$ if I know that points coordinates? 
 A: Rotations of sphere are linear transformations, so you can use formula from "Beginner's guide to mapping simplexes affinely", section "Linear transformations".
Let's treat rotated points as vectors $\vec{p}_{1r}$, $\vec{p}_{2r}$, $\vec{p}_{3r}$, the answer can be written in the following neat form
$$
\vec{R}(p^x; p^y; p^z) = (-1)
\frac{
    \det
        \begin{pmatrix}
            0   & \vec{p}_{1r} & \vec{p}_{2r} & \vec{p}_{3r} \\
            p^x & p_1^x        & p_2^x        & p_3^x        \\
            p^y & p_1^y        & p_2^y        & p_3^y        \\
            p^z & p_1^z        & p_2^z        & p_3^z        \\
        \end{pmatrix}
}{
    \det
        \begin{pmatrix}
            p_1^x        & p_2^x        & p_3^x        \\
            p_1^y        & p_2^y        & p_3^y        \\
            p_1^z        & p_2^z        & p_3^z        \\
        \end{pmatrix}
},
$$
where upper indices designate components ($x$, $y$, $z$); $p^x$, $p^y$, and $p^z$ are coordinates of the point you are mapping.
Expanding matrix in the numerator along the first column and rearranging everything you can get canonical form -- matrix times vector.
General procedure of the matrix recovery is described in the "Beginner's guide to mapping simplexes affinely", section "canonical form", or you can check for concrete example in "Workbook on mapping simplexes affinely", section "Linear transformation by points".
