17 tfloat d12 = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ) ;
18 tfloat d23 = sqrt( (x3-x2)*(x3-x2) + (y3-y2)*(y3-y2) ) ;
20 tfloat phi1 = alpha1 - alpha2 ;
21 tfloat phi2 = alpha2 - alpha3 ;
23 tfloat gamma1 = atan2( (y2-y1) , (x2-x1) ) ;
24 tfloat gamma2 = atan2( (y3-y2) , (x3-x2) ) ;
26 tfloat R1 = d12 / ( 2 * Sin( phi1 ) ) ;
27 tfloat R2 = d23 / ( 2 * Sin( phi2 ) ) ;
29 tfloat theta1 = acos( d12 / ( 2 * R1 ) ) ;
30 tfloat theta2 = acos( d23 / ( 2 * R2 ) ) ;
32 tfloat cx1 = x1 + R1 * Cos( gamma1 - theta1 ) ;
33 tfloat cy1 = y1 + R1 * Sin( gamma1 - theta1 ) ;
35 tfloat cx2 = x2 + R2 * Cos( gamma2 - theta2 ) ;
36 tfloat cy2 = y2 + R2 * Sin( gamma2 - theta2 ) ;
38 tfloat d = sqrt( (cx2-cx1)*(cx2-cx1) + (cy2-cy1)*(cy2-cy1) ) ;
40 tfloat phi = acos( ( R1 * R1 + d * d - R2 * R2 ) / ( 2 * R1 * d ) ) ;
41 tfloat sigma = atan2( ( cy2 - cy1 ) , ( cx2 - cx1 ) ) ;
43 *x = cx1 + R1 * Cos( phi - sigma ) ;
44 *y = cy1 - R1 * Sin( phi - sigma ) ;
58 tfloat d12 = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ) ;
59 tfloat d23 = sqrt( (x3-x2)*(x3-x2) + (y3-y2)*(y3-y2) ) ;
61 tfloat phi1 = alpha1 - alpha2 ;
62 tfloat phi2 = alpha2 - alpha3 ;
64 tfloat gamma1 = atan2( (y2-y1) , (x2-x1) ) ;
65 tfloat gamma2 = atan2( (y3-y2) , (x3-x2) ) ;
67 tfloat R1 = d12 / ( 2 * Sin( phi1 ) ) ;
68 tfloat R2 = d23 / ( 2 * Sin( phi2 ) ) ;
70 tfloat cx1 = x1 + R1 * Sin( gamma1 + phi1 ) ;
71 tfloat cy1 = y1 - R1 * Cos( gamma1 + phi1 ) ;
73 tfloat cx2 = x2 + R2 * Sin( gamma2 + phi2 ) ;
74 tfloat cy2 = y2 - R2 * Cos( gamma2 + phi2 ) ;
76 tfloat d = sqrt( (cx2-cx1)*(cx2-cx1) + (cy2-cy1)*(cy2-cy1) ) ;
78 tfloat phi = acos( ( R1*R1 + d*d - R2*R2 ) / ( 2 * R1 * d ) ) ;
79 tfloat sigma = atan2( ( cy2 - cy1 ) , ( cx2 - cx1 ) ) ;
82 tfloat R1x = cx1 + R1 * Cos( phi - sigma ) ;
83 tfloat R1y = cy1 - R1 * Sin( phi - sigma ) ;
84 tfloat v1 = sqrt( (R1x-x2)*(R1x-x2) + (R1y-y2)*(R1y-y2) ) ;
86 tfloat R2x = cx1 + R1 * Cos( phi + sigma ) ;
87 tfloat R2y = cy1 + R1 * Sin( phi + sigma ) ;
88 tfloat v2 = sqrt( (R2x-x2)*(R2x-x2) + (R2y-y2)*(R2y-y2) ) ;
double tfloat
Defines the type for float/double.