34 int i, area, n_points;
38 static int first_time = 1;
40 double vx1, vx2, vy1, vy2, vz1, vz2;
46 if (first_time == 1) {
52 G_debug(3,
"TIN: area = %d", area);
56 Area = Plus->
Area[area];
68 for (i = 0; i < 3; i++) {
69 G_debug(3,
"TIN: %d %f %f %f", i,
x[i],
y[i],
z[i]);
79 a = vy1 * vz2 - vy2 * vz1;
80 b = vz1 * vx2 - vz2 * vx1;
81 c = vx1 * vy2 - vx2 * vy1;
82 d = -a *
x[0] -
b *
y[0] - c *
z[0];
85 *tz = -(d + a * tx +
b * ty) / c;
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_get_area_points(struct Map_info *, int, struct line_pnts *)
Returns polygon array of points (outer ring) of given area.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_find_area(struct Map_info *, double, double)
Find the nearest area.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
struct Plus_head plus
Plus info (topology, version, ...)
plus_t n_isles
Number of islands inside.
Basic topology-related info.
struct P_area ** Area
Array of areas.
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
double * x
Array of X coordinates.
int n_points
Number of points.
double * z
Array of Z coordinates.
int Vect_tin_get_z(struct Map_info *Map, double tx, double ty, double *tz, double *angle UNUSED, double *slope UNUSED)
Calculates z coordinate for point from TIN.