感谢感谢!!!
let a = function locate(x1, y1, x2, y2, x3, y3) {
var a, b;
a = (y2 - y1) / (x2 - x1);
b = y1 - a * x1;
var xMiddle = (x1 + x2) / 2;
var yMiddle = (y1 + y2) / 2;
var c, lastX, lastY;
if (a != 0) {
c = yMiddle - (-1 / a) * xMiddle;
lastX = (Math.pow(x1, 2) + Math.pow(y1, 2) - Math.pow(x3, 2) - Math.pow(y3, 2) - 2 * c * y1 + 2 * c * y3) / (2 * ((x1 - x3) - (1 / a) * (y1 - y3)));
lastY = (-1 / a) * lastX + c;
} else {
lastX = c = xMiddle;
lastY = (Math.pow(x1, 2) + Math.pow(y1, 2) - Math.pow(x3, 2) - Math.pow(y3, 2) + 2 * lastX * (x3 - x1)) / (2 * (y1 - y3));
}
console.log("定位点X坐标: " + lastX);
console.log("定位点Y坐标: " + lastY);
}