p3.y = p2.y + b*x3p;
x = p1.x-p2.x; y = p1.y-p2.y;
d1 = p1.d; d2 = p2.d;
norm = sqrt(x*x + y*y);
a = x/norm; b = y/norm;
x1p = a*x + b*y;
x0 = (x1p + (d1*d1-d2*d2)/x1p)/2;
r = sqrt((x1p-x0)*(x1p-x0)+d1*d1);
x1pp = (x1p-x0)/r; x2pp = -x0/r;
theta1 = acos(x1pp);
theta2 = acos(x2pp);
t1 = log(tan(theta1/2));
t2 = log(tan(theta2/2));
t3 = t1 + s*(t2-t1);
theta3 = 2*atan(exp(t3));
x3pp = cos(theta3);
d3pp = sin(theta3);
x3p = x0 + r*x3pp;
p3.d = r*d3pp;
p3.x = p2.x + a*x3p;
