The equation of a line refers to an equation in x and y which all points on that line satisfy. You have tried to find out the length of the line-segment AB which is not required. The following link should help.

Linear equation - Wikipedia, the free encyclopedia