已知两点坐标,求经过这两点的直线方程ax+by+c = 0或者y=kx+B
已知:A(x1,y1),B(x2,y2)
求:直线AB的a,b,c或者k,B
temp = sqrt((x1-x2)**2 + (y1-y2)**2)
a = (y2-y1) / temp
b = (x1-x2) / temp
c = (x2*y1 - x1*y2) / temp
k = (y2-y1) / (x2-x1)
B = (x1*y2-x2*y1)/(x2-x1)
已知两点坐标,求经过这两点的直线方程ax+by+c = 0或者y=kx+B
已知:A(x1,y1),B(x2,y2)
求:直线AB的a,b,c或者k,B
temp = sqrt((x1-x2)**2 + (y1-y2)**2)
a = (y2-y1) / temp
b = (x1-x2) / temp
c = (x2*y1 - x1*y2) / temp
k = (y2-y1) / (x2-x1)
B = (x1*y2-x2*y1)/(x2-x1)