28 #if defined( _MSC_VER ) || defined( __MINGW32__ )
30 #define finite( A ) _finite( A )
31 #ifndef MOAB_HAVE_FINITE
32 #define MOAB_HAVE_FINITE
50 assert( number_nodes >= 3 );
54 MB->
get_coords( &( connectivity[0] ), 1, coords[0] );
55 MB->
get_coords( &( connectivity[1] ), 1, coords[1] );
56 MB->
get_coords( &( connectivity[2] ), 1, coords[2] );
59 vecs[0][0] = coords[1][0] - coords[0][0];
60 vecs[0][1] = coords[1][1] - coords[0][1];
61 vecs[0][2] = coords[1][2] - coords[0][2];
62 vecs[1][0] = coords[2][0] - coords[0][0];
63 vecs[1][1] = coords[2][1] - coords[0][1];
64 vecs[1][2] = coords[2][2] - coords[0][2];
66 x = vecs[0][1] * vecs[1][2] - vecs[0][2] * vecs[1][1];
67 y = vecs[0][2] * vecs[1][0] - vecs[0][0] * vecs[1][2];
68 z = vecs[0][0] * vecs[1][1] - vecs[0][1] * vecs[1][0];
70 double mag = sqrt( x * x + y * y + z * z );
71 if( mag > std::numeric_limits< double >::epsilon() )
87 coord[0] = coord[1] = coord[2] = 0.0;
89 for(
int i = 0; i < number_nodes; i++ )
91 double node_coords[3];
92 MB->
get_coords( &( connectivity[i] ), 1, node_coords );
94 coord[0] += node_coords[0];
95 coord[1] += node_coords[1];
96 coord[2] += node_coords[2];
99 coord[0] /= (double)number_nodes;
100 coord[1] /= (double)number_nodes;
101 coord[2] /= (double)number_nodes;
177 template bool Util::is_finite< double >(
double value );