摘要:
原理: 1) 求出向量ao在ab上的投影距离 2) a沿着ab方向移动投影距离就是垂足点的位置 // 获得原点到直线ab的垂点 public static Vector2 GetPerpendicularToOrigin(Vector2 a, Vector2 b) { var ab = b - a; 阅读全文
摘要:
直线方程的一般式:ax+by+c=0 点p(x1, y1)到直线的距离: //点到直线的距离(一般式表示直线) public static float PointToLineDistance(Vector2 point, float a, float b, float c) { //直线一般式: a 阅读全文