var ax = -1;
var ay = 0;
var bx = 1;
var by = 0;
var ab = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));
var ac = 1;
var bc = 1;
//验证数据
//var ax = 4088.368;
//var ay = 1992.79;
//var bx = 4734.408;
//var by = 2444.842;
//var ab = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));
//var ac = 385.23;
//var bc = 492.57;
//输出
//4252.88118224958
//2341.12542134862
//4471.98580959676
//2027.99694619228
L = ab;
if (bx == ax || by == ay) {
K1 = 0;
K2 = 0;
} else {
K1 = (by - ay) / (bx - ax);
K2 = -1 / K1;
}
X0 = ax + (bx - ax) * (Math.pow(ac, 2) - Math.pow(bc, 2) + Math.pow(L, 2)) / (2 * Math.pow(L, 2));
Y0 = ay + K1 *