GetCircleCenter(x1,y1,x2,y2,r){ let c1 = (x2 * x2 - x1 * x1 + y2 * y2 - y1 * y1) / (2 * (x2 - x1)); let c2 = (y2 - y1) / (x2 - x1); let A = c2 * c2 + 1; let B = (2 * x1 * c2 - 2 * c1 * c2 - 2 * y1); let C = x1 * x1 - 2 * x1 * c1 + c1 * c1 + y1 * y1 - r * r; //圆心坐标1 let r_y = (-B + Math.sqrt(B * B - 4 * A * C)) / 2 / A; let r_x = c1 - c2 * r_y; //圆心坐标2 // let r_y = (-B - Math.sqrt(B * B - 4 * A * C)) / 2 / A; // let r_x = c1 - c2 * r_y; return [r_x, r_y] },
标签:圆点,x2,y1,let,坐标,半径,c2,c1,x1 From: https://www.cnblogs.com/ren17/p/17955933