176 int64_t i1 = 0, i2 = 0, n1 = f1->
length, n2 = f2->
length, mode;
177 double dx1, dx2, x1MinP, x1Min, x2Max;
178 double f1x1 = 0, f1y1 = 0, f1x2 = 0, f1y2 = 0, f2x1 = 0, f2y1 = 0, f2x2 = 0, f2y2 = 0;
179 double f1x1p, f1y1p, f1x2p, f1y2p, f2x1p, f2y1p, f2x2p, f2y2p;
184 x2Max = f2->
points[0].
x + ( y - yMin );
187 x1MinP = y - f2->
points[n2 - 1].
x;
188 if( x1Min < x1MinP ) x1Min = x1MinP;
198 i1 = lessThanEqualXPoint.
index;
200 f1y1p = f1y1 = f1->
points[i1].
y;
218 i2 = lessThanEqualXPoint.
index;
219 if( i2 < f2->length - 1 ) i2++;
221 f2y2p = f2y2 = f2->
points[i2].
y;
235 while( ( i1 < n1 ) && ( i2 >= 0 ) ) {
240 if( dx1 < dx2 ) mode = 1;
244 if( f2x1p < f2->points[i2].x ) {
250 *c += ( ( f1y1p + f1y2p ) * ( f2y1p + f2y2p ) + f1y1p * f2y2p + f1y2p * f2y1p ) * dx1;
252 if( i1 == n1 )
break;
256 f1y2p = f1y2 = f1->
points[i1].
y;
262 if( ( f1x2p > f1->
points[i1].
x ) || ( dx1 == dx2 ) ) {
268 *c += ( ( f1y1p + f1y2p ) * ( f2y1p + f2y2p ) + f1y1p * f2y2p + f1y2p * f2y1p ) * dx2;
274 f2y1p = f2y1 = f2->
points[i2].
y;
281 f1y2p = f1y2 = f1->
points[i1].
y; }
ptwXY_interpolation interpolation
nfu_status ptwXY_interpolatePoint(ptwXY_interpolation interpolation, double x, double *y, double x1, double y1, double x2, double y2)
enum ptwXY_lessEqualGreaterX_e ptwXY_lessEqualGreaterX
enum nfu_status_e nfu_status
ptwXY_lessEqualGreaterX ptwXY_getPointsAroundX(ptwXYPoints *ptwXY, double x, ptwXYOverflowPoint *lessThanEqualXPoint, ptwXYOverflowPoint *greaterThanXPoint)