PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ triarea3d()

static double triarea3d ( const double *  P1,
const double *  P2,
const double *  P3 
)
static

Calculate the area of a triangle in 3d space.

Definition at line 81 of file effectivearea.c.

References area(), and LWDEBUG.

Referenced by ptarray_calc_areas(), and tune_areas().

82 {
83  LWDEBUG(2, "Entered triarea3d");
84  double ax,bx,ay,by,az,bz,cx,cy,cz, area;
85 
86  ax=P1[0]-P2[0];
87  bx=P3[0]-P2[0];
88  ay=P1[1]-P2[1];
89  by=P3[1]-P2[1];
90  az=P1[2]-P2[2];
91  bz=P3[2]-P2[2];
92 
93  cx = ay*bz - az*by;
94  cy = az*bx - ax*bz;
95  cz = ax*by - ay*bx;
96 
97  area = fabs(0.5*(sqrt(cx*cx+cy*cy+cz*cz)));
98  return area;
99 }
Datum area(PG_FUNCTION_ARGS)
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
Here is the call graph for this function:
Here is the caller graph for this function: