16 tfloat d12 = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ) ;
17 tfloat d23 = sqrt( (x3-x2)*(x3-x2) + (y3-y2)*(y3-y2) ) ;
19 tfloat phi1 = alpha1 - alpha2 ;
20 tfloat phi2 = alpha2 - alpha3 ;
22 tfloat sin_phi1 = Sin( phi1 ) ;
23 tfloat sin_phi2 = Sin( phi2 ) ;
25 tfloat Phi1 = HALFPI - atan2( (y2-y1) , (x2-x1) ) ;
26 tfloat Phi2 = HALFPI - atan2( (y3-y2) , (x3-x2) ) ;
28 tfloat w = QUARTPI + atan( ( d12 * sin_phi2 ) / ( d23 * sin_phi1 ) ) ;
30 tfloat v = HALFPI - ( Phi1 - Phi2 + phi1 + phi2 ) / 2 ;
32 tfloat gamma = v + atan( tan(v) / tan(w) ) ;
34 tfloat dAP = d12 * Sin( gamma + phi1 ) / sin_phi1 ;
36 *x = x1 + dAP * Sin( Phi1 + gamma ) ;
37 *y = y1 + dAP * Cos( Phi1 + gamma ) ;
46 tfloat d12 = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ) ;
47 tfloat d23 = sqrt( (x3-x2)*(x3-x2) + (y3-y2)*(y3-y2) ) ;
49 tfloat phi1 = alpha1 - alpha2 ;
50 tfloat phi2 = alpha2 - alpha3 ;
52 tfloat sigma1 = -atan2( (y2-y1) , (x2-x1) ) ;
53 tfloat sigma2 = -atan2( (y3-y2) , (x3-x2) ) ;
55 tfloat R1 = d12 / ( 2 * Sin( phi1 ) ) ;
56 tfloat R2 = d23 / ( 2 * Sin( phi2 ) ) ;
58 tfloat xn = x1 - R1 * Sin( sigma1 - phi1 ) ;
59 tfloat yn = y1 - R1 * Cos( sigma1 - phi1 ) ;
61 tfloat xm = x2 - R2 * Sin( sigma2 - phi2 ) ;
62 tfloat ym = y2 - R2 * Cos( sigma2 - phi2 ) ;
64 tfloat m = ( ym - yn ) / ( xn - xm ) ;
65 tfloat n = ( R2*R2 - R1*R1 - xm*xm + xn*xn - ym*ym + yn*yn ) / ( 2*( xn - xm ) ) ;
67 *y = ( ( 2*m*xn + 2*yn - 2*m*n ) / ( 1 + m*m ) ) - y2 ;
double tfloat
Defines the type for float/double.