4inline int side3h_3d_filter(
const double* p0,
const double* p1,
const double* p2,
const double* p3,
double h0,
double h1,
double h2,
double h3,
const double* q0,
const double* q1,
const double* q2) {
11 double p1_0_p0_0 = (p1[0] - p0[0]);
12 double q0_0_p0_0 = (q0[0] - p0[0]);
13 double p1_1_p0_1 = (p1[1] - p0[1]);
14 double q0_1_p0_1 = (q0[1] - p0[1]);
15 double p1_2_p0_2 = (p1[2] - p0[2]);
16 double q0_2_p0_2 = (q0[2] - p0[2]);
18 a10 = (2 * (((p1_0_p0_0 * q0_0_p0_0) + (p1_1_p0_1 * q0_1_p0_1)) + (p1_2_p0_2 * q0_2_p0_2)));
19 double q1_0_p0_0 = (q1[0] - p0[0]);
20 double q1_1_p0_1 = (q1[1] - p0[1]);
21 double q1_2_p0_2 = (q1[2] - p0[2]);
23 a11 = (2 * (((p1_0_p0_0 * q1_0_p0_0) + (p1_1_p0_1 * q1_1_p0_1)) + (p1_2_p0_2 * q1_2_p0_2)));
24 double q2_0_p0_0 = (q2[0] - p0[0]);
25 double q2_1_p0_1 = (q2[1] - p0[1]);
26 double q2_2_p0_2 = (q2[2] - p0[2]);
28 a12 = (2 * (((p1_0_p0_0 * q2_0_p0_0) + (p1_1_p0_1 * q2_1_p0_1)) + (p1_2_p0_2 * q2_2_p0_2)));
29 double p2_0_p0_0 = (p2[0] - p0[0]);
30 double p2_1_p0_1 = (p2[1] - p0[1]);
31 double p2_2_p0_2 = (p2[2] - p0[2]);
33 a20 = (2 * (((p2_0_p0_0 * q0_0_p0_0) + (p2_1_p0_1 * q0_1_p0_1)) + (p2_2_p0_2 * q0_2_p0_2)));
35 a21 = (2 * (((p2_0_p0_0 * q1_0_p0_0) + (p2_1_p0_1 * q1_1_p0_1)) + (p2_2_p0_2 * q1_2_p0_2)));
37 a22 = (2 * (((p2_0_p0_0 * q2_0_p0_0) + (p2_1_p0_1 * q2_1_p0_1)) + (p2_2_p0_2 * q2_2_p0_2)));
38 double p3_0_p0_0 = (p3[0] - p0[0]);
39 double p3_1_p0_1 = (p3[1] - p0[1]);
40 double p3_2_p0_2 = (p3[2] - p0[2]);
42 a30 = (2 * (((p3_0_p0_0 * q0_0_p0_0) + (p3_1_p0_1 * q0_1_p0_1)) + (p3_2_p0_2 * q0_2_p0_2)));
44 a31 = (2 * (((p3_0_p0_0 * q1_0_p0_0) + (p3_1_p0_1 * q1_1_p0_1)) + (p3_2_p0_2 * q1_2_p0_2)));
46 a32 = (2 * (((p3_0_p0_0 * q2_0_p0_0) + (p3_1_p0_1 * q2_1_p0_1)) + (p3_2_p0_2 * q2_2_p0_2)));
48 b00 = ((a11 * a22) - (a12 * a21));
54 b10 = ((a12 * a20) - (a10 * a22));
60 b20 = ((a10 * a21) - (a11 * a20));
66 Delta = ((b00 + b10) + b20);
68 DeltaLambda0 = (((b01 * l1) + (b02 * l2)) + b00);
70 DeltaLambda1 = (((b11 * l1) + (b12 * l2)) + b10);
72 DeltaLambda2 = (((b21 * l1) + (b22 * l2)) + b20);
74 r = ((Delta * l3) - (((a30 * DeltaLambda0) + (a31 * DeltaLambda1)) + (a32 * DeltaLambda2)));
76 double max1 = fabs(q2_2_p0_2);
77 if( (max1 < fabs(q0_0_p0_0)) )
79 max1 = fabs(q0_0_p0_0);
81 if( (max1 < fabs(q0_1_p0_1)) )
83 max1 = fabs(q0_1_p0_1);
85 if( (max1 < fabs(q0_2_p0_2)) )
87 max1 = fabs(q0_2_p0_2);
89 if( (max1 < fabs(q1_0_p0_0)) )
91 max1 = fabs(q1_0_p0_0);
93 if( (max1 < fabs(q1_1_p0_1)) )
95 max1 = fabs(q1_1_p0_1);
97 if( (max1 < fabs(q1_2_p0_2)) )
99 max1 = fabs(q1_2_p0_2);
101 if( (max1 < fabs(q2_0_p0_0)) )
103 max1 = fabs(q2_0_p0_0);
105 if( (max1 < fabs(q2_1_p0_1)) )
107 max1 = fabs(q2_1_p0_1);
109 double max2 = fabs(p2_0_p0_0);
110 if( (max2 < fabs(p2_1_p0_1)) )
112 max2 = fabs(p2_1_p0_1);
114 if( (max2 < fabs(p2_2_p0_2)) )
116 max2 = fabs(p2_2_p0_2);
118 double max3 = fabs(p1_0_p0_0);
119 if( (max3 < fabs(p1_1_p0_1)) )
121 max3 = fabs(p1_1_p0_1);
123 if( (max3 < fabs(p1_2_p0_2)) )
125 max3 = fabs(p1_2_p0_2);
127 double lower_bound_1;
128 double upper_bound_1;
131 lower_bound_1 = max1;
132 upper_bound_1 = max1;
133 if( (max2 < lower_bound_1) )
135 lower_bound_1 = max2;
139 if( (max2 > upper_bound_1) )
141 upper_bound_1 = max2;
144 if( (max3 < lower_bound_1) )
146 lower_bound_1 = max3;
150 if( (max3 > upper_bound_1) )
152 upper_bound_1 = max3;
155 if( (lower_bound_1 < 2.22985945097100191780e-74) )
157 return FPG_UNCERTAIN_VALUE;
161 if( (upper_bound_1 > 2.59614842926741294957e+33) )
163 return FPG_UNCERTAIN_VALUE;
165 eps = (8.99983341597279045654e-14 * (((max3 * max1) * max2) * max1));
178 return FPG_UNCERTAIN_VALUE;
182 Delta_sign = int_tmp_result;
184 if( (max4 < fabs(l1)) )
188 if( (max4 < fabs(l2)) )
197 if( (max5 < fabs(l3)) )
202 if( (max6 < fabs(q2_2_p0_2)) )
204 max6 = fabs(q2_2_p0_2);
206 if( (max6 < fabs(q0_0_p0_0)) )
208 max6 = fabs(q0_0_p0_0);
210 if( (max6 < fabs(q0_1_p0_1)) )
212 max6 = fabs(q0_1_p0_1);
214 if( (max6 < fabs(q0_2_p0_2)) )
216 max6 = fabs(q0_2_p0_2);
218 if( (max6 < fabs(q2_0_p0_0)) )
220 max6 = fabs(q2_0_p0_0);
222 if( (max6 < fabs(q2_1_p0_1)) )
224 max6 = fabs(q2_1_p0_1);
227 if( (max7 < fabs(p3_0_p0_0)) )
229 max7 = fabs(p3_0_p0_0);
231 if( (max7 < fabs(p3_1_p0_1)) )
233 max7 = fabs(p3_1_p0_1);
235 if( (max7 < fabs(p3_2_p0_2)) )
237 max7 = fabs(p3_2_p0_2);
240 int int_tmp_result_FFWKCAA;
241 lower_bound_1 = max6;
242 upper_bound_1 = max6;
243 if( (max5 < lower_bound_1) )
245 lower_bound_1 = max5;
249 if( (max5 > upper_bound_1) )
251 upper_bound_1 = max5;
254 if( (max1 < lower_bound_1) )
256 lower_bound_1 = max1;
260 if( (max1 > upper_bound_1) )
262 upper_bound_1 = max1;
265 if( (max4 < lower_bound_1) )
267 lower_bound_1 = max4;
271 if( (max4 > upper_bound_1) )
273 upper_bound_1 = max4;
276 if( (max7 < lower_bound_1) )
278 lower_bound_1 = max7;
282 if( (max7 > upper_bound_1) )
284 upper_bound_1 = max7;
287 if( (lower_bound_1 < 5.53478725478149652989e-50) )
289 return FPG_UNCERTAIN_VALUE;
293 if( (upper_bound_1 > 2.59614842926741294957e+33) )
295 return FPG_UNCERTAIN_VALUE;
297 eps = (7.73996217364502738018e-13 * (((((max7 * max1) * max6) * max1) * max5) * max4));
300 int_tmp_result_FFWKCAA = 1;
306 int_tmp_result_FFWKCAA = -1;
310 return FPG_UNCERTAIN_VALUE;
314 r_sign = int_tmp_result_FFWKCAA;
315 return (Delta_sign * r_sign);