19 #include <grass/Vect.h>
23 #define HUGE_VAL 9999999999999.0
35 struct line_pnts *BPoints)
37 register int i, j,
point, start, end, inc;
38 struct line_pnts *Points;
41 BPoints->n_points = 0;
49 for (i = 0; i < n_lines; i++) {
51 n_points += Points->n_points - 1;
60 for (i = 0; i < n_lines; i++) {
62 if (direction[i] > 0) {
64 end = Points->n_points - 1;
68 start = Points->n_points - 1;
73 for (j = start; j != end; j += inc) {
74 BPoints->
x[
point] = Points->x[j];
75 BPoints->y[
point] = Points->y[j];
80 BPoints->x[
point] = Points->x[j];
81 BPoints->y[
point] = Points->y[j];
83 BPoints->n_points = n_points;
85 return (BPoints->n_points);
97 double tot_area, sum_area;
108 for (i = 1; i < Points->n_points; i++) {
109 sum_area += (x[i] - x[i - 1]) * (y[i] + y[i - 1]);
111 tot_area += sum_area;
113 *totalarea = 0.5 * tot_area;
int dig_get_poly_points(int n_lines, struct line_pnts **LPoints, int *direction, struct line_pnts *BPoints)
int dig_alloc_points(struct line_pnts *points, int num)
int dig_find_area_poly(struct line_pnts *Points, double *totalarea)