解当x1=x2时,直线方程为x-x1=0
当y1=y2时,直线方程为y-y1=0
当x1≠x2,y1≠y2时,
直线的斜率k=(y2-y1)/(x2-x1)
故直线方程为y-y1=(y2-y1)/(x2-x1)×(x-x1)
即x2y-x1y-x2y1+x1y1=(y2-y1)x-x1(y2-y1)
即为(y2-y1)x-(x2-x1)y-x1(y2-y1)+(x2-x1)y1=0
即为(y2-y1)x-(x2-x1)y-x1y2+x2y1=0
解当x1=x2时,直线方程为x-x1=0
当y1=y2时,直线方程为y-y1=0
当x1≠x2,y1≠y2时,
直线的斜率k=(y2-y1)/(x2-x1)
故直线方程为y-y1=(y2-y1)/(x2-x1)×(x-x1)
即x2y-x1y-x2y1+x1y1=(y2-y1)x-x1(y2-y1)
即为(y2-y1)x-(x2-x1)y-x1(y2-y1)+(x2-x1)y1=0
即为(y2-y1)x-(x2-x1)y-x1y2+x2y1=0