The line is defined by two vectors:
The first vector defines the direction of the line; it corresponds to $axis on the code from my previous post.
The second vector indicates the positions of some point of the line relative to the origin (it can be any point on the line). It is what I have called $offset.
The rotate_3d performs the rotation around a line passing through the origin and with the given direction, so to use it to rotate a vector $p around a line that does not pass through the origin, we have to perform a translation, rotate the vector and undo the translation.
In practice, that means, subtracting the vector $offset to $p, performing the rotation, and then adding $offset to the resulting value.
