30 #include <grass/interpf.h> 44 double *gmin,
double *gmax,
45 double *c1min,
double *c1max,
46 double *c2min,
double *c2max,
52 dx2 = 0, dy2 = 0, grad2 = 0,
62 int i, got, bmask = 1;
63 static int first_time_g = 1;
69 for (i = ngstc; i <= nszc; i++) {
70 if (bitmask !=
NULL) {
71 bmask =
BM_get(bitmask, i, k);
75 while ((got == 0) && (cond1)) {
76 dx2 = (double)(params->
adx[i] * params->
adx[i]);
77 dy2 = (double)(params->
ady[i] * params->
ady[i]);
82 slp = ro * atan(grad);
83 if (grad <= gradmin) {
99 if (params->
adx[i] == 0.) {
100 if (params->
ady[i] > 0.)
106 oor = ro * atan2(params->
ady[i], params->
adx[i]);
113 if ((got != 3) && (cond2)) {
115 dnorm1 = sqrt(grad2 + 1.);
117 2. * (double)(params->
adxy[i] * params->
adx[i] *
122 (double)(params->
adxx[i] * dx2 + dxy2 +
123 params->
adyy[i] * dy2) / (grad2 * dnorm1 *
127 (double)(params->
adxx[i] * dy2 - dxy2 +
128 params->
adyy[i] * dx2) / (grad2 * dnorm1);
132 .5 * ((1. + dy2) * params->
adxx[i] - dxy2 +
133 (1. + dx2) * params->
adyy[i]) / (temp * dnorm1);
138 *c1min = *c1max = curn;
139 *c2min = *c2max = curh;
141 *gmin =
amin1(*gmin, slp);
142 *gmax =
amax1(*gmax, slp);
143 *c1min =
amin1(*c1min, curn);
144 *c1max =
amax1(*c1max, curn);
145 *c2min =
amin1(*c2min, curh);
146 *c2max =
amax1(*c2max, curh);
int IL_secpar_loop_2d(struct interp_params *params, int ngstc, int nszc, int k, struct BM *bitmask, double *gmin, double *gmax, double *c1min, double *c1max, double *c2min, double *c2max, int cond1, int cond2)
double amax1(double, double)
int BM_get(struct BM *, int, int)
Gets 'val' from the bitmap.
double amin1(double, double)