15 #include <grass/dataquad.h>
59 for (i = 0; i <= kmax; i++) {
77 int cond1, cond2, cond3, cond4, rows,
cols;
78 double ew_res, ns_res;
86 if (data->
n_rows % 2 == 0) {
93 if (data->
n_cols % 2 == 0) {
99 cond1 = (point->
x >= data->
x_orig);
100 cond2 = (point->
x >= data->
x_orig + ew_res *
cols);
101 cond3 = (point->
y >= data->
y_orig);
102 cond4 = (point->
y >= data->
y_orig + ns_res * rows);
103 if (cond1 && cond3) {
126 fprintf(stderr,
"add_data: data is NULL \n");
129 for (i = 0; i < data->
n_points; i++) {
132 r = xx * xx + yy * yy;
158 xmin = data_inter->
x_orig;
159 xmax = data_inter->
xmax;
160 ymin = data_inter->
y_orig;
161 ymax = data_inter->
ymax;
165 || ((ymin >= data->
y_orig) && (ymin <= data->ymax))
168 || ((xmin >= data->
x_orig) && (xmin <= data->xmax)
169 && (((ymin >= data->
y_orig) && (ymin <= data->ymax))
206 int cols1, cols2, rows1, rows2, i;
208 double xr, xm, xl, yr, ym, yl;
209 double ew_res, ns_res;
216 "Points are too concentrated -- please increase DMIN\n");
220 if (data->
n_cols % 2 == 0) {
228 if (data->
n_rows % 2 == 0) {
254 for (i = 0; i < data->
n_points; i++) {
296 xmin = data_inter->
x_orig;
297 xmax = data_inter->
xmax;
298 ymin = data_inter->
y_orig;
299 ymax = data_inter->
ymax;
304 if ((point->
x > xmin) && (point->
x < xmax)
305 && (point->
y > ymin) && (point->
y < ymax)) {
307 data_inter->
points[ind].
x = point->
x;
308 data_inter->
points[ind].
y = point->
y;
309 data_inter->
points[ind].
z = point->
z;
int quad_intersect(struct quaddata *data_inter, struct quaddata *data)
struct triple * quad_point_new(double x, double y, double z, double sm)
struct quaddata * quad_data_new(double x_or, double y_or, double xmax, double ymax, int rows, int cols, int n_points, int kmax)
int quad_compare(struct triple *point, struct quaddata *data)
struct quaddata ** quad_divide_data(struct quaddata *data, int kmax, double dmin)
int quad_division_check(struct quaddata *data, int kmax)
int quad_add_data(struct triple *point, struct quaddata *data, double dmin)
int quad_get_points(struct quaddata *, struct quaddata *, int)