I have a line defined by two points, $q_1$ and $q_2$, and a cloud of three-dimensional points around the line, $Q$.
I rotate, but do not dilate/stretch the line by moving $q_1$ to some $t_1$ and $q_2$ to some $t_2$. In other words, the Euclidean distance between $q_1$ and $q_2$, and between $t_1$ and $t_2$, is the same. How do I correspondingly map the points to this new orientation s.t. their positions relative to the line remain unchanged?
Note that the full set of equations for rotations about an arbitrary axis are provided here: http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/
For convenience, below I provide the Mathematica input for a rotation matrix about an arbitrary axis defined by points $P_1 = (a,b,c)$ & $P_2 = (d,e,f)$, with direction vector $<u,v,w> = (d-a,e-b,f-c)$, where "theta" = $\theta$ is the rotation angle (in radians), and where $L = (u^2+v^2+w^2)$. The three-dimensional point to be rotated is given by $(x,y,z)$.
RotationMatrixArbitraryLine = {((a*(v^2 + w^2) - u*(b*v + c*w - u*x - v*y - w*z))*(1 - Cos[theta]) + L*x*Cos[theta] + L^(1/2)*(-c*v + b*w - w*y + v*z)Sin[theta])/ L, ((b(u^2 + w^2) - v*(a*u + c*w - u*x - v*y - w*z))*(1 - Cos[theta]) + L*y*Cos[theta] + L^(1/2)*(c*u - a*w + w*x - u*z)Sin[theta])/ L, ((c(u^2 + v^2) - w*(a*u + b*v - u*x - v*y - w*z))*(1 - Cos[theta]) + L*z*Cos[theta] + L^(1/2)*(-b*u + a*v - v*x + u*y)*Sin[theta])/L}
The above expression works on the tests I have provided. For example, a $\theta = \frac{\pi}{4}$ degree rotation of the point {0,0,1} about direction vector {1,0,0} maps the point to {0,-1,0}. Changing the direction vector to {0,1,0} maps the same point to {1,0,0}.