Simplest way is to build a full 4x4 matrix for the 'inline' ref line.
Then inverse it and apply it to all the others.
Your math lib should have an inverse function.
Then inverse it and apply it to all the others.
Your math lib should have an inverse function.