33 double tx,
double ty,
double *tz,
double *angle,
double *slope)
35 int i, area, n_points;
39 static int first_time = 1;
41 double vx1, vx2, vy1, vy2, vz1, vz2;
47 if (first_time == 1) {
53 G_debug(3,
"TIN: area = %d", area);
57 Area = Plus->
Area[area];
69 for (i = 0; i < 3; i++) {
70 G_debug(3,
"TIN: %d %f %f %f", i, x[i], y[i], z[i]);
80 a = vy1 * vz2 - vy2 * vz1;
81 b = vz1 * vx2 - vz2 * vx1;
82 c = vx1 * vy2 - vx2 * vy1;
83 d = -a * x[0] - b * y[0] - c * z[0];
86 *tz = -(d + a * tx + b * ty) / c;
struct P_area ** Area
Array of areas.
int n_points
Number of points.
double * x
Array of X coordinates.
Feature geometry info - coordinates.
Basic topology-related info.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
struct Plus_head plus
Plus info (topology, version, ...)
plus_t n_isles
Number of islands inside.
int Vect_find_area(struct Map_info *, double, double)
Find the nearest area.
double * y
Array of Y coordinates.
double * z
Array of Z coordinates.
int Vect_get_area_points(const struct Map_info *, int, struct line_pnts *)
Returns polygon array of points (outer ring) of given area.
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_tin_get_z(struct Map_info *Map, double tx, double ty, double *tz, double *angle, double *slope)
Calculates z coordinate for point from TIN.