28 #if defined( _MSC_VER ) || defined( __MINGW32__ )
30 #define finite( A ) _finite( A )
31 #ifndef MOAB_HAVE_FINITE
32 #define MOAB_HAVE_FINITE
49 assert( number_nodes >= 3 );
53 MB->
get_coords( &( connectivity[0] ), 1, coords[0] );
54 MB->
get_coords( &( connectivity[1] ), 1, coords[1] );
55 MB->
get_coords( &( connectivity[2] ), 1, coords[2] );
58 vecs[0][0] = coords[1][0] - coords[0][0];
59 vecs[0][1] = coords[1][1] - coords[0][1];
60 vecs[0][2] = coords[1][2] - coords[0][2];
61 vecs[1][0] = coords[2][0] - coords[0][0];
62 vecs[1][1] = coords[2][1] - coords[0][1];
63 vecs[1][2] = coords[2][2] - coords[0][2];
65 x = vecs[0][1] * vecs[1][2] - vecs[0][2] * vecs[1][1];
66 y = vecs[0][2] * vecs[1][0] - vecs[0][0] * vecs[1][2];
67 z = vecs[0][0] * vecs[1][1] - vecs[0][1] * vecs[1][0];
69 double mag = sqrt( x * x + y * y + z * z );
70 if( mag > std::numeric_limits< double >::epsilon() )
85 coord[0] = coord[1] = coord[2] = 0.0;
87 for(
int i = 0; i < number_nodes; i++ )
89 double node_coords[3];
90 MB->
get_coords( &( connectivity[i] ), 1, node_coords );
92 coord[0] += node_coords[0];
93 coord[1] += node_coords[1];
94 coord[2] += node_coords[2];
97 coord[0] /= (double)number_nodes;
98 coord[1] /= (double)number_nodes;
99 coord[2] /= (double)number_nodes;
175 template bool Util::is_finite< double >(
double value );