The Kabsch Algorithm finds the optimal translation and rotation that minimizes the distance between two sets of matched points.
A rotation matrix is really just an orthonormal basis (a set of three orthogonal, unit vectors representing the x, y, and z bases of your rotation).
One of my favorite functions projects points onto line segments.
Orthogonal Regression is the process of finding the line that best fits a set of points by minimizing their squared orthogonal distances to it.
Inverse Kinematics is the process of finding a set of joint angles that reach a goal position.