mlib.line.closestPoint takes 2 points on the slope

or the slope and y-intercept.