You have two points (x1,y1) and (x2,y2).
for the equation y = m.x + b
m = (y2-y1)/(x2-x1)
b = y1 - m.x1