Solve the equation y - b = m(x - a) for a.
y - b = m(x - a)
(y - b)/m = x - a
a = x - (y-b)/m
like that?