Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
orient4d.h
1/* Automatically generated code, do not edit */
2/* Generated from source file: orient4d.pck */
3
4inline int orienth_3d_filter( const double* p0, const double* p1, const double* p2, const double* p3, const double* p4, double h0, double h1, double h2, double h3, double h4) {
5 double a00;
6 a00 = (p1[0] - p0[0]);
7 double a01;
8 a01 = (p1[1] - p0[1]);
9 double a02;
10 a02 = (p1[2] - p0[2]);
11 double a03;
12 a03 = (h1 - h0);
13 double a10;
14 a10 = (p2[0] - p0[0]);
15 double a11;
16 a11 = (p2[1] - p0[1]);
17 double a12;
18 a12 = (p2[2] - p0[2]);
19 double a13;
20 a13 = (h2 - h0);
21 double a20;
22 a20 = (p3[0] - p0[0]);
23 double a21;
24 a21 = (p3[1] - p0[1]);
25 double a22;
26 a22 = (p3[2] - p0[2]);
27 double a23;
28 a23 = (h3 - h0);
29 double a30;
30 a30 = (p4[0] - p0[0]);
31 double a31;
32 a31 = (p4[1] - p0[1]);
33 double a32;
34 a32 = (p4[2] - p0[2]);
35 double a33;
36 a33 = (h4 - h0);
37 double m12;
38 m12 = ((a10 * a01) - (a00 * a11));
39 double m13;
40 m13 = ((a20 * a01) - (a00 * a21));
41 double m14;
42 m14 = ((a30 * a01) - (a00 * a31));
43 double m23;
44 m23 = ((a20 * a11) - (a10 * a21));
45 double m24;
46 m24 = ((a30 * a11) - (a10 * a31));
47 double m34;
48 m34 = ((a30 * a21) - (a20 * a31));
49 double m123;
50 m123 = (((m23 * a02) - (m13 * a12)) + (m12 * a22));
51 double m124;
52 m124 = (((m24 * a02) - (m14 * a12)) + (m12 * a32));
53 double m134;
54 m134 = (((m34 * a02) - (m14 * a22)) + (m13 * a32));
55 double m234;
56 m234 = (((m34 * a12) - (m24 * a22)) + (m23 * a32));
57 double Delta;
58 Delta = ((((m234 * a03) - (m134 * a13)) + (m124 * a23)) - (m123 * a33));
59 int int_tmp_result;
60 double eps;
61 double max1 = fabs(a00);
62 if( (max1 < fabs(a10)) )
63 {
64 max1 = fabs(a10);
65 }
66 if( (max1 < fabs(a20)) )
67 {
68 max1 = fabs(a20);
69 }
70 if( (max1 < fabs(a30)) )
71 {
72 max1 = fabs(a30);
73 }
74 double max2 = fabs(a01);
75 if( (max2 < fabs(a11)) )
76 {
77 max2 = fabs(a11);
78 }
79 if( (max2 < fabs(a21)) )
80 {
81 max2 = fabs(a21);
82 }
83 if( (max2 < fabs(a31)) )
84 {
85 max2 = fabs(a31);
86 }
87 double max3 = fabs(a02);
88 if( (max3 < fabs(a12)) )
89 {
90 max3 = fabs(a12);
91 }
92 if( (max3 < fabs(a22)) )
93 {
94 max3 = fabs(a22);
95 }
96 if( (max3 < fabs(a32)) )
97 {
98 max3 = fabs(a32);
99 }
100 double max4 = fabs(a03);
101 if( (max4 < fabs(a13)) )
102 {
103 max4 = fabs(a13);
104 }
105 if( (max4 < fabs(a23)) )
106 {
107 max4 = fabs(a23);
108 }
109 if( (max4 < fabs(a33)) )
110 {
111 max4 = fabs(a33);
112 }
113 double lower_bound_1;
114 double upper_bound_1;
115 lower_bound_1 = max1;
116 upper_bound_1 = max1;
117 if( (max2 < lower_bound_1) )
118 {
119 lower_bound_1 = max2;
120 }
121 else
122 {
123 if( (max2 > upper_bound_1) )
124 {
125 upper_bound_1 = max2;
126 }
127 }
128 if( (max3 < lower_bound_1) )
129 {
130 lower_bound_1 = max3;
131 }
132 else
133 {
134 if( (max3 > upper_bound_1) )
135 {
136 upper_bound_1 = max3;
137 }
138 }
139 if( (max4 < lower_bound_1) )
140 {
141 lower_bound_1 = max4;
142 }
143 else
144 {
145 if( (max4 > upper_bound_1) )
146 {
147 upper_bound_1 = max4;
148 }
149 }
150 if( (lower_bound_1 < 2.89273249588395233567e-74) )
151 {
152 return FPG_UNCERTAIN_VALUE;
153 }
154 else
155 {
156 if( (upper_bound_1 > 7.23700557733225900010e+75) )
157 {
158 return FPG_UNCERTAIN_VALUE;
159 }
160 eps = (3.17768858673611390687e-14 * (((max1 * max2) * max3) * max4));
161 if( (Delta > eps) )
162 {
163 int_tmp_result = 1;
164 }
165 else
166 {
167 if( (Delta < -eps) )
168 {
169 int_tmp_result = -1;
170 }
171 else
172 {
173 return FPG_UNCERTAIN_VALUE;
174 }
175 }
176 }
177 return int_tmp_result;
178}