How to maintain the alignment

Have a look at this post. By varying “m” between [0.0 … 1.0] you get all points on the line between A and B.