def GeneralEquation(first_x,first_y,second_x,second_y): # 一般式 Ax+By+C=0 A = second_y-first_y B = first_x-second_x C = second_x*first_y-first_x*second_yreturn A, B, C
以上是返回一般式方程的Ax+By+C=0的A、B、C
def GeneralEquation(first_x,first_y,second_x,second_y): # 一般式 Ax+By+C=0 A = second_y-first_y B = first_x-second_x C = second_x*first_y-first_x*second_y k = -1 * A / B b = -1 * C / B return k, b
以上是返回截距式方程的y=kx+b的k和b