/* 两个不同点A,B确定一条直线,AB相同返回的值全0
* 直线方程:Ax+By+c=0
* A = y2 - y1;
* B = x1 - x2;
* C = -A*x1 - B*y1 = x2*y1 - x1*y2;
*/
Line LineMake(Point A, Point B)
{
Line l;
l.A = B.y - A.y;
l.B = A.x - B.x;
l.C = B.x * A.y - A.x * B.y;
return l;
}
C语言平面几何5-两点确定一条直线
最新推荐文章于 2022-11-15 16:33:51 发布