We will define an arbitrary line by a point the line goes through and a direction vector. If the axisof rotation is given by two pointsP1= (a,b,c) andP2= (d,e,f), then a direction vector can beobtained by⟨u,v,w⟩=⟨d-a,e-b,f-c⟩. We can now write a transformation for the rotation ofa point about this line.
Assuming that⟨u,v,w⟩is a unit vector so thatL= 1, we obtain a more practical result forTP1-1Txz-1Tz-1Rz(θ)TzTxzTP1.
If we multiply this times⟨x,y,z⟩we can obtain a function of of ten variables that yields theresult of rotating the point (x,y,z) about the line through (a,b,c) with direction vector⟨u,v,w⟩(whereu2+v2+w2= 1) by the angleθ.