Calculate a rotation around an arbitrary axis Suppose I have two 3D triangles before &amp; after a single rotation around an unknown axis.
How would I go about finding this axis?
Take a point $P$ and it's rotated point $P'$.

Find the plan that runs through the middle between them $C = \frac{P+P'}{2}$ and is perpendicular to the line connecting them.

Do this for all 3 of them and find the line of the planes' intersection. That will be the rotation axis.

If all mid-planes are coplanar then you can use the planes of the triangles themselves.

To get the angle you can take a $P$ and $P'$ again and project them onto the axis.

Take a point $A$ on the axis and the direction $v$ of the axis. The projected point is $P_p=A+\frac{v \cdot (P-A)}{v\cdot v} v$. And then the angle is $acos(\frac{dot(P-P_p, P'-P_p)}{|P-P_p|* |P'-P_p|})$