Let the points be (p,q) and (r,s). The slope is (s-q)/(r-p). The equation is y-s=(s-q)(x-r)/(r-p). This can be written (y-s)(r-p)=(s-q)(x-r). y(r-p)-s(r-p)=x(s-q)-r(s-q); y(r-p)=x(s-q)+rs-ps-rs+qr; y=x(s-q)/(r-p)+(qr-ps)/(r-p). Note that r cannot be equal to p in this standard form. If r=p we have a vertical line x=p. If q=s we have the horizontal line y=q.