Well, if A.x and A.y are the coordinates for point A, and same logic for B

with let's say course being a variable between 0 and 1

you have lerp(A.X, B.X, course) returning an X value

lerp(A.Y, B.Y, course) will return the Y value on the same line corresponding to that X, as long as course is between 0 and 1, the point will be between them.

EDIT: if you prefer the actual equation of the line (AB), you can have it: